Meteor: file upload error

- 1 answer

Ad

I've been trying to use the meteor-uploads package (https://github.com/tomitrescak/meteor-uploads) to create a file upload system for my test webapp, the code for which can be found here:

http://meteorpad.com/pad/ckgN6GL4msQn4Ms5h/Jobs

I have made sure to install the necessary packages:

meteor add tomi:upload-server
meteor add tomi:upload-jquery

I couldn't find these on meteorpad so the link above probably won't work.

When I try this on my local machine, I get an error that says UploadServer is not defined, which then leads to file uploads giving a 503 error

I changed the code slightly from the example provided in the tutorial. When I use their code directly everything seems to work OK.

What/where is the error in my code that is causing the problem?

Ad

Answer

Ad

It turns out that this is because process.env.PWD returns undefined on Windows systems. This then leads to the uploader trying to upload to a directory without permissions. I've fixed this, for now, by manually specifying the upload directory path

Ad
source: stackoverflow.com
Ad