richardgirges / express-fileupload

Simple express file upload middleware that wraps around busboy
MIT License
1.52k stars 261 forks source link

Using temp files #322

Closed mrhotmadm closed 2 years ago

mrhotmadm commented 2 years ago

Hey there,

I am a bit confused in the areas and topics revolving around temp files, so I would like some clarification. I couldn't find an answer to this anywhere else.

I want to get file data from a form sent to the server and then download or write the file data to a static folder. I know that using temp files returns an empty Buffer as the data and also creates a temp file in the default 'tmp' folder.

What should I do in order to accomplish my goal? As in do I get the temp file and move it to the static folder, or is there something else that in meant to be done? In other words, is this middleware meant for what I'm trying to do or should I consider an alternative?

Thanks.

gjf7 commented 2 years ago

Hi! You can use mv method that express-fileupload provided! https://github.com/richardgirges/express-fileupload/tree/master/example#basic-file-upload