         document.body.appendChild @hiddenFileInput
         @hiddenFileInput.addEventListener "change", =>
           files = @hiddenFileInput.files
-          if files.length
-            @handleFiles files
+          @addFile file for file in files if files.length
           setupHiddenFileInput()
       setupHiddenFileInput()
 

    else
      throw new Error "This file can't be queued because it has already been processed or was rejected."

  # Used to read a directory, and call addFile() with every file found.
  addDirectory: (entry, path) ->
    dirReader = entry.createReader()


    entriesReader = (entries) =>
      for entry in entries
        if entry.isFile
          entry.file (file) =>
            return if @options.ignoreHiddenFiles and file.name.substring(0, 1) is '.'
            file.fullPath = "#{path}/#{file.name}"
            @addFile file
        else if entry.isDirectory
          @addDirectory entry, "#{path}/#{entry.name}"
      return

    dirReader.readEntries entriesReader, (error) -> console?.log? error 


  # Can be called by the user to remove a file
  removeFile: (file) ->
    @cancelUpload file if file.status == Dropzone.UPLOADING

    dragover: (e) -> @element.classList.add "dz-drag-hover"
    dragleave: (e) -> @element.classList.remove "dz-drag-hover"

    paste: noop

    # Called whenever there are no files left in the dropzone anymore, and the
    # dropzone should be displayed as if in the initial state.
    reset: ->
