Skip to main content

data:image file not able to be processed as image



  • Aleksandar Kostadinov

    Hi David,

    I see that from your example you're using our Auto-Upload feature to allow Cloudinary to pull assets from your Cloudfront CDN which retrieves them from S3. Those files serve a text/plain content of Base64 strings.

    For us to be able to grab the image from the remote source and store it in Cloudinary when using Auto-Upload, the actual image bytes need to be served back. Returning Base64 content will not work with Auto-Upload because the response will be text and therefore be rejected when attempted to be processed as an "image".

    If you want to use Base64 to migrate assets to Cloudinary then that is possible, however, you would need to pass the Base64 String as the "file" parameter when calling the upload() method. In that case, we would take the Base64 and upload the contents of that as an image. You can ensure existing URLs work by passing the public_id parameter in the upload() call with a value for each image - in your example you would pass the public_id as "cache/1/62/3f/623fa0375aa45cd48247c201fc55401effdd1ff40faa593bfd16fb6b7d04ad69-MmQ5MGY0M2EtMjI2ZS00ZGI1LTgxMjItNWFmZTM2MGM5MzRl" and then your existing URL via Cloudinary would work.

    Please try this out and let us know how it goes.

  • David Kuck

    Thank you for your help! I will try this out for base64 content.


  • Aleksandar Kostadinov

    Sounds good, David - let us know how it goes.


Post is closed for comments.