i am implementing the s3 bucket in aws sam lambda function. i am facing this error
UnicodeDecodeError while processing HTTP request: 'utf-8' codec can't decode byte 0xff in position 182: invalid start byte
2024-05-03 01:05:23 127.0.0.1 - - [03/May/2024 01:05:23] "POST /upload HTTP/1.1" 502 -
why question is this
If you attach an image directly (rather than providing base64-encoded image data in the request body), the error may not occur because the AWS SDK is not involved in decoding the base64-encoded image data from the request body. Instead, the image data is passed directly to the AWS S3 service without any decoding needed.
if i pass json like this
{
"image": "base64"
}
this code is being exceuted. but directly image is not handled. any solution for this.
i have tried many ways. all in veins. nothing worked
only i found this line
If you attach an image directly (rather than providing base64-encoded image data in the request body), the error may not occur because the AWS SDK is not involved in decoding the base64-encoded image data from the request body. Instead, the image data is passed directly to the AWS S3 service without any decoding needed.
is there any way to upload image to the s3 bucket locally
or any code, github repo