Hello, I am trying save images uploaded in retool in my database by POST API base64 of the image. I'm using file uploader and I can get base64 (from fileInput.value), but base64 string is too large and I get payload is too big error when I try to pass base64 with POST API. Is there a way to compress bade64?
Hello, here is a good question about base64 compression for your reference.
Base64 is already encoded in a way which does not suit most compression algorithms
@AnsonHwang I didn't find answer in that post, most comments said it's not possible to compress base64. What could be an alternative? How can I pass selected image with POST API?(without getting large payload error)
How about save image to Retool fileStorage or something alike, such as amazon s3, and keep the file id in your database field?
It's not recommend to save such a big file data to database.
@AnsonHwang I'll be saving image to google storage bucket(to get url), so I need to pass base64 (or buffer), but base64 is too large. I tried to use compressjs(by adding library) to compress the image( fileinput.files), but I get Compress is not defined when I run query.