     new Uint8Array fileContent.slice sample.offset, sample.offset + sample.size
   Meteor.call 'verify-publication', publicationId, samplesData, (error) ->
     if error
-      ImportingFile.documents.update file._id,
-        $set:
-          errored: true
-          status: error.toString()
+      uploadMarkComplete
+        errored: true
+        status: error.toString()
       return
 
-    ImportingFile.documents.update file._id,
-      $set:
-        finished: true
-        publicationId: publicationId
+    uploadMarkComplete
+      finished: true
+      publicationId: publicationId
 
 uploadFile = (file, publicationId) ->
+  ImportingFile.documents.update file._id,
+    $set:
+      status: "Uploading file"
   meteorFile = new MeteorFile file,
     collection: ImportingFile.Meta.collection
 

    uploadProgress: 0
    finished: false
    errored: false
    file: file
  ,
    # We are using callback to make sure ImportingFiles really has the file now
    (error, id) ->

  ,
    (error) ->
      if error
        uploadMarkComplete
          errored: true
          status: error.toString()
        return

      uploadMarkComplete
        finished: true
        publicationId: publicationId

testPDF = (file, fileContent, callback) ->
  PDFJS.getDocument(data: fileContent, password: '').then callback, (message, exception) ->
