Search code examples
node.jsamazon-web-servicesamazon-s3knox-amazon-s3-client

Can we upload image directly from url to amazon S3


I am using nodejs and trying to upload file from url to amazon s3 directly.

Here is my code

knox.putFile('http://www.wikihow.com/Image:Make-Handprint-Art-Step-1.jpg','foldername/'+new_image_name, {"Content-Type": "image/jpeg",'x-amz-acl': 'public-read'}, function (err, result) {
                    console.log(JSON.stringify(result));

            });

But console.log ios showing undefined. Also there is no image on Amazon S3.

Any Suggestions

Thanks


Solution

  • There's currently no way to do this -- you have to first download the file from the URL, then upload it into Amazon.