DEV Community

Bruce Axtens
Bruce Axtens

Posted on

1

Wordpress says, "rest_upload_sideload_error" for a recognized type in an image upload from Google Apps Script. Why?

0

Context: uploading images to WordPress.

I've been digging around on this for a while. There are lots of StackOverflow postings about the issue, including this one from which I have derived the code below.

function test3() {
    const png = DriveApp.getFileById('id of a png file')
    const parm = {};
    parm.method

Top comments (1)

Collapse
 
bugmagnet profile image
Bruce Axtens

In this case, the "problem" was with Sucuri which needed to be told to whitelist googlecontent IP addresses, namely 107.178.0.0/16. Once Sucuri stopped blocking the traffic, the image was uploaded.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay