I am trying to upload a file to AWS s3 using express js,instead of putObject i am using upload http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property function
var options ={
partSize: 5242880, queueSize: 1
};
console.time('Uploadtime');
s3.upload(params,options,function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
console.timeEnd('Uploadtime');
console.log("uploaded",data);
res.json({
'status':'Uploaded'
});
} // successful response
});
I think upload and multipart upload do the same thing(am i correct??)
My question is do i need to use multi part upload or stay with upload method.
From the docs i can't get the similarities between upload and multipartupload
upload and multipart upload perform the same action but there are the few advantage of multipart upload
You can upload parts in parallel to improve throughput.
Smaller part size minimizes the impact of restarting a failed upload due to a network error.
You can upload object parts over time. Once you initiate a multipart upload
there is no expiry; you must explicitly complete or abort the multipart upload.
You can upload an object as you are creating it.
So you can decide which one you should go with according to your need , multipart is recommended when the object you are uploading is big in size .