Meteor: file upload error
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?
Answer
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
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM