filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

Upload base64 image doesn't work #429

Closed daviCalavera closed 2 years ago

daviCalavera commented 3 years ago

Hi guys, I have a possibly issue when tried to upload base64 string.

// prepare string (I've checked with online image decode and the image is ok)
const inputFile = `data:${image.mime};base64,${image.data}`;
// call client (Based on official doc):
filestackClient.upload(inputFile, { onRetry }, { filename: 'profile.jpg' }, token)

The upload is success but the response content-type is "text/plain" not image. filestack response:

{
id: 457
fp_id: "pvuEkaCTTbKe7VFB3JBt_profile.jpg"
content_type: "text/plain; charset=utf-8"
user_id: 14043
created_at: "2021-03-30T18:20:25+02:00"
src_url: "https://d1t35hkz8sx2bl.cloudfront.net/api/file/pvuEkaCTTbKe7VFB3JBt_profile.jpg"
}

When I try on my browser the src_url get "Bad Request" status.

Any idea what happens? Thanks

pcholuj commented 3 years ago

Hi, we need to do more investigation about this bug. I will let you know soon

pcholuj commented 3 years ago

We just released version 3.23.1, this should fix problems with b64 encoded images @daviCalavera can you confirm ?

daviCalavera commented 3 years ago

I apologize, I forgot to mention I was using filestack-js: 3.21.1 I will update and test it. Thanks @pcholuj I let you know soon

daviCalavera commented 2 years ago

Sorry the delay, the version 3.23.1 fix problem.