Meteor - cfs-gridFS not working production server but works fine on local server

405 Views Asked by At

I am having issues uploading images to my meteorJs app using CollectionFS/ GridFs packages. The app works fine with image upload on my localhost but when I deploy to a production server and try to upload an image, I get a broken image, and when i visit the image url, i get this error

Error in method "/cfs/files/:value/:value/", Error: TypeError: Cannot read property 'Images' of undefined
at Object.httpGetHandler (packages/cfs_access-point/packages/cfs_access-point.js:357:1)
at Object.accessPoint.get (packages/cfs_access-point/packages/cfs_access-point.js:675:1)
at packages/cfs_http-methods/http.methods.server.api.js:581:1

I have tried several solutions like dropping the database or even deleting and creating a new server, but the result is still the same.

I am using these packages

cfs:standard-packages cfs:gridfs

Update Code Snippet

`//collection
postImages = new FS.Collection("postimages", {
stores: [new FS.Store.GridFS("postimages", {})]
});
//permissions
postImages.allow({
  insert: function(userId, doc){return true;},
  download: function(userId){return true;}
});`

Any suggestions on how to solve this?

Thanks

0

There are 0 best solutions below