Exploring Sanity? Take control of your content – watch the demo

Troubleshooting image upload issues with Sanity's Assets API

6 replies
Last updated: Nov 30, 2024
Hey guys, I've been having trouble uploading images to sanity so I attempted to try it on postman with different pictures as well and I'm still getting this error.
Nov 30, 2024, 1:39 PM
I see the one file is a jpeg, but your assigning to a png file. If you leave the format the same, does it work as expected?
Nov 30, 2024, 2:32 PM
the second one isnt a real image and i can remove it and it still won't work
Nov 30, 2024, 9:14 PM
Using the
form-data
type will (I assume) send the header
Content-Type: multipart/form-data
, which isn’t what the Assets API expects . I would try changing the body type to
binary
.
Nov 30, 2024, 9:25 PM
Thank you for the help!
Nov 30, 2024, 10:58 PM
It works now
Nov 30, 2024, 10:59 PM
Great!
Nov 30, 2024, 11:10 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?