anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Files uploaded using package completely stored in system memory? #53

Closed ShaggyDev closed 8 years ago

ShaggyDev commented 8 years ago

Hey there, was looking for something like this that would stream a file uploaded through API request and just wanted to validate the functionality of this helper package. I was curious if the file that is being uploaded through the request is being stored in local system memory completely before uploading to S3, or is this streaming the file to S3 as the API is receiving the file in parts? The reason I am curious and looking for a explicit answer is I am wondering if Ill be able to use this method of uploading to S3 if the files being uploaded are a bit larger than those of simple photos, such as small video clips. If it will store the full video clip before streaming to S3, then I fear that multiple requests to upload files would result in over memory usage faster than if each request was only storing a small amount of the file that needs to be uploaded to S3 at a time.

LinusU commented 8 years ago

It streams the file, as can be seen here: https://github.com/badunk/multer-s3/blob/master/index.js#L121

Happy hacking!