Title: create attachment
Last modified: August 31, 2016

---

# create attachment

 *  [Goharika](https://wordpress.org/support/users/goharika/)
 * (@goharika)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/create-attachment/)
 * Hi everyone,
    I am getting rest_upload_no_content_disposition error when sending
   post request [https://mysite.com/wp-json/wp/v2/media?access_token=](https://mysite.com/wp-json/wp/v2/media?access_token=)
   and in headers setting content type as image/png for example.
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/create-attachment/#post-7203723)
 * Are you setting the Content-Disposition header too?
 * Here’s how it’s supposed to work: [https://github.com/WP-API/WP-API/blob/develop/tests/test-rest-attachments-controller.php#L407-L410](https://github.com/WP-API/WP-API/blob/develop/tests/test-rest-attachments-controller.php#L407-L410)
 *  Thread Starter [Goharika](https://wordpress.org/support/users/goharika/)
 * (@goharika)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/create-attachment/#post-7203747)
 * yes I have put like they attachment; filename=image.png
    now returns { “code”:“
   rest_upload_invalid_disposition”, “message”: “Invalid Content-Disposition supplied.
   Content-Disposition needs to be formatted as \”filename=image.png\” or similar.”,“
   data”: { “status”: 400 } }
 *  [Gnanasekaran Loganathan](https://wordpress.org/support/users/gnanasekaran/)
 * (@gnanasekaran)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/create-attachment/#post-8523830)
 * [@goharika](https://wordpress.org/support/users/goharika/) I got the same error,
   Did you got the solution.
 *  [Gnanasekaran Loganathan](https://wordpress.org/support/users/gnanasekaran/)
 * (@gnanasekaran)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/create-attachment/#post-8524790)
 * [@goharika](https://wordpress.org/support/users/goharika/) add in header Content-
   Disposition
 * Content-Disposition : attachment; filename=”imagename.jpg”

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘create attachment’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Gnanasekaran Loganathan](https://wordpress.org/support/users/gnanasekaran/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/create-attachment/#post-8524790)
 * Status: not resolved