Issues Uploading Image via API | Community
Skip to main content
Chris_Francis
New Participant
April 5, 2017
Solved

Issues Uploading Image via API

  • April 5, 2017
  • 1 reply
  • 2615 views

I know what I am doing wrong is probably a very simple fix but I can't find it.  See my curl request below

curl.exe -k -X POST -H "Authorization: Bearer 7a15dbf7-bd65-****-****-************:**" -H "Content-Type: application/json"-H "Accept: application/json" -F "folder={\"id\":****, \"type\":\"Folder\"}" -F "name=myFirstApiFile.jpg" -F "file=@D:\*****\*****\*****\header.img" ***-***-***.mktorest.com/rest/asset/v1/files.json

I receive 701: file is mandatory.  But as you can see file is clearly one of my posted fields.

Best answer by Chris_Francis

figured it out.  needed to drop the "Content-Type" Header

1 reply

Chris_Francis
Chris_FrancisAuthorAccepted solution
New Participant
April 5, 2017

figured it out.  needed to drop the "Content-Type" Header

Shruti_Khullar
New Participant
August 30, 2018

Hi Chris, I am facing the same issue.

Could you please share the code snippet for uploading an image via API.

Thanks in advance!