     else
       uploadFile importingFiles[document._id], result.publicationId
 
-
 computeChecksum = (file, callback) ->
   hash = new Crypto.SHA256
     onProgress: (progress) ->


  reader = new FileReader()
  reader.onload = ->
    importingFiles[document._id].content = @result
    testPDF importingFiles[document._id], ->
      computeChecksum importingFiles[document._id], (error, result) ->
        if error
          ImportingFile.documents.update document._id,
            $set:

# Local (client-only) document of importing files
class ImportingFile extends Document
  # name: user's file name
  # status: current status or error message
  # readProgress: progress of reading from file, in %
  # uploadProgress: progress of uploading file, in %
  # preprocessingProgress: progress of file preprocessing, in %
  # finished: true when importing has finished
  # errored: true when there was an error
  # canceled: true when user cancels import
