You need to sign in to do that
Don't have an account?

REST image upload of base64 file not recognised
I am using REST service "/services/data/v41.0/connect/files/users/me" to upload a base64 encoded image file. The upload works and i can see the file under the Files tab, but it is not recognised as an image file, and when downloaded it is the base64 characters. It seems the REST upload is not converting the base64 data back into a native png graphics file.
Any idea why or how i solve this?
I am posting these headers and body:
Headers:
Content-Type: multipart/form-data; boundary=boundary_string
Body:
--boundary_string
Content-Disposition: form-data; name="entity_content";
Content-Type: application/json
{
"title": "sean"
}
--boundary_string
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Disposition: form-data; name="fileData"; filename="image.png"
Content-Transfer-Encoding: binary
<base64 data here>
--boundary_string--
Any idea why or how i solve this?
I am posting these headers and body:
Headers:
Content-Type: multipart/form-data; boundary=boundary_string
Body:
--boundary_string
Content-Disposition: form-data; name="entity_content";
Content-Type: application/json
{
"title": "sean"
}
--boundary_string
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Disposition: form-data; name="fileData"; filename="image.png"
Content-Transfer-Encoding: binary
<base64 data here>
--boundary_string--
it is the actual binary data which should go here, not the base64-encoded.