upload base64 image to s3 via S3 pre-singed URL

Viewed 397

I have been trying to upload base64 encoded image to S3 via S3 get signed URL

const url = await s3client.getSignedUrlPromise('putObject', {
              Bucket: 'DEV_BUCKET',
              Key: 'image.svg',
              Expires: 3600,
              ContentType: 'image/svg+xml',
              ContentEncoding: 'base64'
            });

the file is stored in S3 but as base64 string. I tried to upload the file from postman and set the right headers as follows:

enter image description here

I am sending the base64 string as a row string body enter image description here

Note: I tried to set the type of the file as binary file and it worked in postman. but what I want is to upload the image as base64 string.

Thanks in advance

0 Answers
Related