Reputation: 1849
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); })
Upvotes: 1
Views: 1027
Reputation: 1849
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...
Upvotes: 0