-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
hi guys, i send a new file with client.uploadFile but the file of wordpress gallery is empty
Here my code:
const fs = require( "fs" );
const client = wordpress.createClient....
const file = fs.readFileSync(fileLocation);
const uploadOptions = {
name: fileName,
type: 'image/jpeg',
bits: file,
};
client.uploadFile(uploadOptions, function (error, fileData) {
console.log(fileData.attachment_id); //83
console.log(fileData.metadata.file); //undefined
console.log(fileData.file); //abvatygaq06.jpg
});
Node version: v10.4.0
Node-wordpress: 1.4.1
Wordpress version 4.9.7
Metadata
Metadata
Assignees
Labels
No labels
