image upload to amazon s3, need to be binary?

i have never used image upload before, don't really understand the mechanism .

Trying to upload image from backend, to amazon s3 buckets. does the image have to be converted to binary in this case?

the following code is what i got from amazon tutorial (can't find a good document&tutorial of how to use their api..)

what i need to add on the code to upload image ?

var params = {Bucket:bucketName, Key: keyName, Body: "?"};

s3.putObject(params, function(err,data){

if(err) console.log(err) else console.log("Successfully uploaded data to " + bucketName + "/" + keyName); })


there's alternative such as readasurl, to convert the image into a string, when the image is small. so.. no need to even use Amazon S3, which is so complicated...

链接地址: http://www.djcxy.com/p/94620.html

上一篇: 上传目录时,将Metada和选项添加到S3对象

下一篇: 图像上传到亚马逊S3,需要二进制?