express-mongoose-es6-rest-api
express-mongoose-es6-rest-api copied to clipboard
Add a upload image API
@KunalKapadia Is this done? I can work on this.
@laumair Not done. It'd be great if you can pick this up. Let's discuss what package we should be using for file upload.
@KunalKapadia Awesome. Do you have any packages in your mind? I have some in mind but I used to use them a couple of months ago, I would have to check on those.
@laumair I don't have anything in mind. Can you let me know what package are you planning to use and what are available options ?
@KunalKapadia Sorry have been a busy lately. https://github.com/expressjs/multer is what I had in mind. Thoughts?
Or maybe https://www.npmjs.com/package/express-fileupload
@laumair I am fine with any reliable module but we need to make sure that it supports streaming. We want to avoid downloading the whole file first. Check this: http://stackoverflow.com/questions/11295554/how-to-disable-express-bodyparser-for-file-uploads-node-js
Can you explore these alternatives:
- https://www.npmjs.com/package/multiparty
- https://www.npmjs.com/package/formidable
- https://github.com/mscdex/busboy (multer is built over this)
Does multer download the file first before being either saved to disk or uploaded to some other server (say s3) ?
Also it'd be great if we can put some check on the file size to be uploaded so that it isn't exploited by uploading large files.
Did a bit of research on the above modules. multer looks good and satisfies our requirements.
@laumair Did you get chance to work on this ?
@KunalKapadia Gonna start on this weekend. Is it high on priority?
@laumair Any updates? Should I pick this up ?
@KunalKapadia Nah I think I'll be making a PR in a couple of days. Probably till this friday.
@KunalKapadia Have started working on this. I am going with adding an endpoint for the upload and have added configuration file for multer for validating file extensions to only support images atm. Do you have anything in mind that I should know of?
multer +1
multer +1
@laumair Any update ?
Any updates?
Do we need this in express-mongoose-es6-rest-api? One can quickly add multer to an individual project, configure it and is ready to go.