           $set:
             sha256: sha256
             status: "In import queue"
+            enqueued: true
+
   reader.onerror = (error) ->
     console.log "Error " + error
     ImportingFile.documents.update document._id,

  ImportingFile.documents.update document._id,
    $set:
      status: "Preprocessing"

  reader = new FileReader()
  reader.onload = ->

      sha256: 1
  return unless document

  ImportingFile.documents.update document._id,
    $set:
      enqueued: false

  Meteor.call 'create-publication', document.name, document.sha256, (error, result) ->
    if error
      ImportingFile.documents.update document._id,
