how to save a file using curl and restapi

7 views
Skip to first unread message

Germany Deutschland

unread,
Feb 12, 2021, 9:37:27 AM2/12/21
to dotCMS User Group
I am trying to send a file to my localhost bug why i am getting bad request




curl -XPUT http://localhost:8080/api/content/save/1   -F "json={   contentType:'fileAsset',
  hostFolder
:'demo.dotcms.com:/images',
     title
:'nice.jpg',  
     fileName
:'nice.jpg'
                 
'stName':'News'

     
};   type=application/json"   -F "file=@liz.jpg;   type=application/jpg"


HTTP/1.1 400
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,HEAD,OPTIONS,PATCH
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: *
Access-Control-Expose-Headers: *
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1160
Date: Fri, 12 Feb 2021 14:26:39 GMT
Connection: close

Reply all
Reply to author
Forward
0 new messages