How to properly upload images with alt text using Payload CMS API #11845
Unanswered
lightlogic5
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The additional fields needs to be set in a json object with name _payload. Not 100% of the syntax, I have not tested it, but something like this: curl -X POST -H "Authorization: Bearer mytoken" \
-F "[email protected]" \
-F '_payload={"alt": "test222"};type=application/json' \
http://localhost:3001/api/media |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to create a media collection in Payload CMS that allows image uploads with required alt text. Here's my collection configuration:
When attempting to upload an image via cURL:
I receive this validation error:
Questions:
Additional context:
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions