express-mongoose-es6-rest-api icon indicating copy to clipboard operation
express-mongoose-es6-rest-api copied to clipboard

Add a upload image API

Open kunalkapadia opened this issue 9 years ago • 18 comments

kunalkapadia avatar Aug 18 '16 13:08 kunalkapadia

@KunalKapadia Is this done? I can work on this.

laumair avatar Oct 02 '16 17:10 laumair

@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 avatar Oct 03 '16 07:10 kunalkapadia

@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 avatar Oct 03 '16 16:10 laumair

@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 avatar Oct 12 '16 12:10 kunalkapadia

@KunalKapadia Sorry have been a busy lately. https://github.com/expressjs/multer is what I had in mind. Thoughts?

laumair avatar Oct 13 '16 13:10 laumair

Or maybe https://www.npmjs.com/package/express-fileupload

laumair avatar Oct 13 '16 13:10 laumair

@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:

  1. https://www.npmjs.com/package/multiparty
  2. https://www.npmjs.com/package/formidable
  3. 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.

kunalkapadia avatar Oct 14 '16 07:10 kunalkapadia

Did a bit of research on the above modules. multer looks good and satisfies our requirements.

kunalkapadia avatar Oct 14 '16 09:10 kunalkapadia

@laumair Did you get chance to work on this ?

kunalkapadia avatar Oct 24 '16 18:10 kunalkapadia

@KunalKapadia Gonna start on this weekend. Is it high on priority?

laumair avatar Oct 28 '16 11:10 laumair

@laumair Any updates? Should I pick this up ?

kunalkapadia avatar Nov 14 '16 18:11 kunalkapadia

@KunalKapadia Nah I think I'll be making a PR in a couple of days. Probably till this friday.

laumair avatar Nov 14 '16 18:11 laumair

@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?

laumair avatar Nov 22 '16 02:11 laumair

multer +1

mathpaquette avatar Dec 05 '16 02:12 mathpaquette

multer +1

wassimz avatar Dec 06 '16 07:12 wassimz

@laumair Any update ?

kunalkapadia avatar Dec 12 '16 17:12 kunalkapadia

Any updates?

ArthurJahn avatar May 19 '17 21:05 ArthurJahn

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.

simonschllng avatar Sep 23 '17 08:09 simonschllng