Meteor CollectionFS / GridFS verify correct upload of a file

52 Views Asked by At

In our Meteor App we sometimes run into the issue, after uploading a file that the generated download link is .../null and the file is not retrievable anymore or never was uploaded correctly.

There are no errors logged at all.

FileUploads.insert(file, function (err, fileObj) {

  if (err) { // this error never triggers
    log(err);
  } else {
    if(fileObj.isUploaded()) { // is true after correct or non correct upload
      FileUploads.find(fileObj._id); // fetches correct metadata even if file upload was corrupt
      if(fileObj.url()=== 'null') {
         throw Meteor.Error(...) // never thrown even when URL was "null"
      }

    }   
  }
 

List of used cfs packages:

cfs:[email protected]_2
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]

So how can we make sure the file was uploaded correctly right after an upload? fileObj,isUploaded() seems not reliable. Is there a better way to verify the correct upload?

0

There are 0 best solutions below