   # Called internally when processing is finished.
   # Individual callbacks have to be called in the appropriate sections.
   errorProcessing: (file, message, xhr) ->
-    @filesProcessing = without(@filesProcessing, file)
-    file.processing = no # Backwards compatibility
     file.status = Dropzone.ERROR
     @processQueue()
     @emit "error", file, message, xhr

  # Goes through the queue and processes files if there aren't too many already.
  processQueue: ->
    parallelUploads = @options.parallelUploads
    processingLength = @filesProcessing.length
    i = processingLength

    while i < parallelUploads
      return unless @filesQueue.length # Nothing left to process
      @processFile @filesQueue.shift()
      i++


  # Loads the file, then calls finishedLoading()
  processFile: (file) ->
    @filesProcessing.push file
    file.processing = yes # Backwards compatibility
    file.status = Dropzone.UPLOADING


      @hiddenFileInput = null


  updateTotalUploadProgress: ->
    totalBytesSent = 0
    totalBytes = 0

    for file in @getAcceptedFiles()
      totalBytesSent += file.upload.bytesSent
      totalBytes += file.upload.total
    totalUploadProgress = 100 * totalBytesSent / totalBytes

    @emit "totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent



  # Returns a form that can be used as fallback if the browser does not support DragnDrop
  #
  # If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.
