Hello,
I’m just running a simple Node.js/Express application on a droplet and I can’t upload files to the designated folder from a html form on a page of the application.
I’m just running the application with ‘node app.js’ and it runs on port 3000. I could be wrong but I don’t think Apache is involved here, is that correct?
I’ve chmod 777’d the folder to where the files go but every time I try and upload a file the application hangs for a few seconds and then gets “Killed”.
The upload location is ‘app_root/public/uploads’
I am aware of the security issues here, I just want to do a little bit of live testing, I don’t plan to the have the application up for long.
Thanks for any help! Jonathan
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Ok, It’s actually Jimp that is cause the problem here. I was trying to resize the file before saving, and it’s failing somewhere here:
whereas if i use ‘express-fileupload’ to save the file, it works fine:
Thanks for any help!
have you included this line your express app setup?
Actually you may need to set up a reverse proxy like nginx which directs all the requests to your node app.
Check this link out. https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#set-up-nginx-as-a-reverse-proxy-server