Cannot upload media
See original GitHub issueEnvironment
nodejs: 10.14.1
wpapi: ^1.2.1
Step to reproduce
Attempt the following code:
const WPAPI = require('wpapi');
var wp = new WPAPI({
endpoint: 'https://www.mysite.com/wp-json',
username: "my_username",
password: "my_password"
})
wp.media()
// Specify a path to the file you want to upload, or a Buffer
.file( 'path/to/file.jpg' )
.create({
title: 'My awesome image'
})
.then(res => {
console.log(res)
})
Expected result
New media would be uploaded
Actual result
All existed media is returned
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
WordPress Can't Upload Images? Here's How to Fix It
Issues Uploading Images to Your Media Library · 1. Go to the /wp-content/ folder after connecting to your website through FTP. · 2....
Read more >How to Fix the WordPress HTTP Error (Uploading Image to ...
The WordPress HTTP error occurs when something goes wrong while attempting to upload images or videos using the built-in media library tool.
Read more >How to Fix Image Upload Issue in WordPress (Step by Step)
The image upload issue in WordPress is typically caused by incorrect file permissions. Your WordPress files are stored on your web hosting ...
Read more >Android - Photos - Album - "Error, couldn't upload media"
Tap the system Settings tab on the main screen of your device. · Tap the General section of settings that is on the...
Read more >Cannot upload file to media library: Unexpected response ...
I am unable to upload certain files to my website's media library, a 1.8mb pdf file in this case. It returns this error:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi. For everyone who is facing this problem for me worked after adding “s” to
http
:https://mywebsite.com
Works properly on WP5.4 but had the same problem mentioned here on WP4.7.3. I think this is related to WordPress version being targeted