       You can archive your files and try again.
       """
 
-    if files.length
+    if items?.item?(0)?.webkitGetAsEntry
+      for item in items
+        entry = item.webkitGetAsEntry()
+        if entry.isDirectory
+          @readDirectory entry.filesystem.root, (files)=>
+            @uploadFiles files, event
+          , =>
+            @uploadFiles files, event
+        else if entry.isFile
+          entry.file (file)=>
+            @uploadFiles [file], event
+    else
+      @uploadFiles files, event
+
+  uploadFiles: (files, event)->
+    @_uploaded or= {}
+    if files?.length
+
       lastFile = files.last
+
       for file, index in files
         sizeInMb = file.size/1024/1024
         if sizeInMb > 100 && @getOptions().uploadToVM

      filePath   = "[#{fsFile.vmName}]#{fsFile.path}"
      parentPath = "[#{fsFile.vmName}]#{fsFile.parentPath}"

      bindAbort = ->
        nodeView.showProgressView 1
        nodeView.once "abortProgress", => fsFile.abort yes

      fsFile._isBeingUploaded = yes
      nodeView = @finder.treeController.nodes[filePath]
      if nodeView
      then bindAbort()
      else
        @finder.treeController.on "NodeWasAdded", (nodeView)->
          if nodeView.getData().path is filePath and fsFile._isBeingUploaded
            bindAbort()

        fsFile.save "", =>
          @finder.expandFolders FSHelper.getPathHierarchy parentPath

    @on "uploadEnd", (fsFile)->
      fsFile._isBeingUploaded = no

  viewAppended: ->
    super

      else
        @emit "uploadFile", fsFile, progress.percent

  upload: (fileName, contents, relativePath)->

    folder = if relativePath and relativePath isnt fileName
    then "#{@path}/#{relativePath.replace /\/[^\/]*$/, ''}"
    else @path

    modalStack   = KDModalView.createStack lastToFirst: yes
    fsFolderItem = FSHelper.createFileFromPath folder, 'folder'
    fsFileItem   = FSHelper.createFileFromPath "#{folder}/#{fileName}"

    return if fsFolderItem.path.match /\/(\.git|__MACOSX)\/?/
    return if fsFileItem.path.match   /\/\.DS_Store/

    upload = =>
      fsFileItem.exists (err, exists)=>
