meteor - How to handle CollectionFS saving failures -


i'm using collectionfs , in particular s3 storage adapter.

most files uploaded fine , can download them afterwards no problem.

occasionally file appears load fine (files.insert(blob,callback) returns callback no error) later when go download them fsfile.url() returns null.

https://github.com/collectionfs/meteor-collectionfs#after-the-upload says:

if storage adapters fail save of copies in designated store, server periodically retry saving them. after configurable number of failed attempts @ saving, server give up.

but there no callback i'm aware of such failure. furthermore when looking @ fsfile.uploadprogress() 100%.

the basic problem during upload looks fine , app detects problem when trying download file.

  1. is there way detect upload failure in storage adapter?

  2. what else fsfile.url() returning null symptomatic of?

here's example of 1 of these broken fsfile objects in mongodb:

{   "_id" : "uqayajqcv68hmejhu",   "original" : {     "updatedat" : isodate("2015-03-16t23:04:37.200z"),     "size" : 699072,     "type" : ""     },   "chunksize" : 2097152,   "chunkcount" : 0,   "chunksum" : 1, } 

on new version of fscollection, there integrated 3 events on server side, stored,uploaded , error.

images.on('error', function (fileobj) {       console.log("the " + fileobj + " _id " + fileobj._id " + error when uploading")     }); 

there not documentation this, since raix , aldeed clean readme.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -