. So I tried to upload by using the same code(uploading parts) in normal node js environment, it works. What would be the problem? At the current stage I give my bucket to public read and write access. Do I need to specify security detail in the code.
This is the code that I used to upload image to s3.
You may also want to consider making AWS S3 presigned URLs in a lambda function and then pass those URLs back to the user app. Doing it that way can be more secure since the user can’t mess with the key and bucket name.
Also check out AWS Amplify which has built in support for uploading images.
Hi bill, I tried to send base64, that is turned in client side, code of image in JSON rather than actual binary image file and send it to lambda. Then the 64 code is turned back to binary data (let binary = new Buffer[‘base64’], ‘base64’) and put it inside s3’s putObject function(Body: binary). That’s it.
Bill, he first passed image in base64 format as which he had shown in figure and that caused the problem, later he changed that base64 to binary format and passed… finally that solved the problem
problem occurred at Body: data[‘base64’],
solved at Body: imageCode,