SOLVED

Issues Uploading Image via API

Go to solution
Chris_Francis
Level 4

Issues Uploading Image via API

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" https://***-***-***.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.

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Chris_Francis
Level 4

Re: Issues Uploading Image via API

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

View solution in original post

2 REPLIES 2
Chris_Francis
Level 4

Re: Issues Uploading Image via API

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

Shruti_Khullar
Level 1

Re: Issues Uploading Image via API

Hi Chris, I am facing the same issue.

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

Thanks in advance!