tomitrescak / meteor-uploads

MIT License
295 stars 41 forks source link

uploadUrl not working as advertised #181

Closed lance-anderson closed 8 years ago

lance-anderson commented 8 years ago

I've got everything working. But when I try and customize the path using uploadUrl the integration breaks. I am using IronRouter.

UploadServer.init({
  // other options
  uploadUrl: '/upload',
})

When I open http://localhost:3000/upload in a browser it correctly returns: Access denied

However, when I change the config to:

UploadServer.init({
  // other options
  uploadUrl: '/public/uploads',
})

If I open http://localhost:3000/public/uploads in a browser I get a 404 instead of the "Access denied" message as I would have expected. This seems to imply that the uploadUrl option is getting ignored. Furthermore, http://localhost:3000/upload continues to return Access denied.

tomitrescak commented 8 years ago

@lance-anderson You are right. There was a bug which omitted the setup of custom urls. It will be fixed in the next release. Also, please beware of using "public" folder name, as in meteor this is reserved name for folder naming. Whatever you put in the public folder of meteor will appear in the root.

tomitrescak commented 8 years ago

I will close it for now, please reopen if necessary.

lance-anderson commented 8 years ago

Thank you for your work and the update @tomitrescak. Much appreciated. Good catch on the use of the public folder... a bad example indeed.

tomitrescak commented 8 years ago

Yes, it has.