Skip to content

PHP WordPress Rest API Example

Justice Ogbonna edited this page Jun 26, 2017 · 3 revisions

In the front-end

Upload.upload({
    url: 'wp-json/wp/v2/media', 
    method: 'POST',
    file: file,
    headers: {
        "Content-Disposition": "attachment; filename=file-name.png",
        "Content-Type": "image/png",
        "Data-Binary": "file-name.png"
})
Clone this wiki locally