WP API v2 image upload from media endpoint Invalid file type.
-
curl -X POST \ https://te*****.org/wp-json/wp/v2/media \ -H 'authorization: Basic ********' \ -H 'cache-control: no-cache' \ -H 'content-disposition: attachment; filename=\"test.jpg\"' \ -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ -H 'postman-token: a5123717-f155-e57b-b057-3*******8' \ -F source_url=@mrkitchengadgets.jpg \ -F width=640 \ -F height=427
The above CURL request is working fine for me. I am getting the media ID in response.
But, when I try to upload the image from the postman, I get the error:
Invalid file type
https://snipboard.io/iQB4m7.jpg
The recent image I upload on technoajeet.org:
https://technoajeet.org/wp-content/uploads/2022/11/test-2.jpgHere is the screenshot of the request:
https://snipboard.io/TKLk04.jpg
https://snipboard.io/g5m6HR.jpgAlso, I have tried uploading the image by giving the file type in the header, but it did not work.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘WP API v2 image upload from media endpoint Invalid file type.’ is closed to new replies.