anacronw/multer-s3

Handling Large Files

Closed this issue ยท 4 comments

I am not able to upload large files using multer-s3. It is not giving me any error as well. It just doesn't upload the file, doesn't even enters the callback and gets timeout. Any way to handle uploading large files to s3 Bucket?

I am using it like this:

var uploadSingle = upload.single('uploadFile');

router.post('/uploadVideo',function(req,res,next){	
	uploadSingle(req,res,function(err){
                // doesn't come here if the file is large
	        if(err){
	            //Error Response , Error while uploading Module PDF;
	        }
	        else{
	            //handling file upload
	           // success response
	        }
	});
}

It doesnt enters the callback of uploadSingle.

+1
Hello, i'm having the same issue, i've tried files from 5mb and isn't working.

+1
having the same issue.
however, large files work on localhost..!

I am just giving it a shot, but can you increase your server timeout value, and see if it works. I think it the upload is not working because the timeout happens even before the file is successfully uploaded .

If you are using nodejs, this line should do it.

server.timeout = timeInMilliseconds
Eg. server.timeout = 10000; //10 seconds

As it happens my problem was happening because of nginx client_max_body_size limit.
I found it out by checking nginx error log of my server.

to fix this, just add something like this to your nginx setting.

client_max_body_size 20M

or whatever MB limit you want.