1

I have some trouble with upload csv file when the app is deployed on Meteor Server. It works on localhost.

I have this error :

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://smsgalaxy.meteor.com' is therefore not allowed access. The response had HTTP status code 503.

I tried to see the FSCollection documentation. I have read something like don't worry about CORS.

I tried also to add this code in the server side from http://enable-cors.org/server_meteor.html :

// Listen to incoming HTTP requests, can only be used on the server
WebApp.connectHandlers.use(function(req, res, next) {
  res.setHeader("Access-Control-Allow-Origin", "*");
  return next();
});

Doesn't work, alas.

Need help. Thanks.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197

1 Answers1

0

Ok, I guess Collection FS doesn't work with Meteor deploy... I have read a commentary on Reddit :

All local storage options hinge on https://github.com/CollectionFS/Meteor-CollectionFS which doesn't work with meteor deploy (as far as I know). The way it works is it breaks the file into chunks and stores the binary data in a Mongo FS Collection.

https://www.reddit.com/r/Meteor/comments/2ove4s/how_should_i_handle_file_upload/