Upload image via HTTP POST with Base64 data URI returns invalid image file bad request
I'm doing an HTTP POST multipart request to upload an image to Cloudinary with the following multipart fields:
"timestamp": "1550013515234",
"folder": "foo",
"tags": "foo,bar",
"eager": "w_400,h_300",
"signature": <redacted>
"api_key": <redacted>
"file": "data:image/jpg;base64,<redacted>"
to https://api.cloudinary.com/v1_1/<redacted>/image/upload
and I keep getting a 400 Bad Request with the body:
{"error":{"message":"Invalid image file"}}"
I've also tried using a local path to the file instead of a Base64 data URI which results in the same error. I've also tried passing a byte array for the file contents. However, using a valid URL to an existing image DOES work. Any help would be much appreciated.
I've tried many different files and both PNG and JPG and nothing seems to matter. However it does work if I use an SVG as a byte array.
-
I want to do the same, any solution yet?
0 -
Hi Felipe,
Can you please contact us at support@cloudinary.com with your cloud name for further investigations?
Looking forward to your response,
Shirly
0
Post is closed for comments.
Comments
2 comments