wp.uploadFile not returning struct
-
Hey all,
I have been working on some code for a site that does some uploading of images and creates a post.
All is mostly OK, but for some reason when I upload images I do not always get a return from my code.
$imagedata = array( 'name' => basename($image), 'type' => 'image/jpg', 'bits' => new IXR_Base64(file_get_contents($image)), 'overwrite' => 1); $client->query( 'wp.uploadFile', '', $user, $passwd, $imagedata); $ret = $client->getResponse(); print_r($ret);Sometimes I do, and sometimes I dont, its really confusing me.
Each time the image is always actually uploaded into wordpress as I can see it in the Media library, I just don’t get a response object from the API call.
Considering that I need the ID to build a slideshow in the actual post, its a tad annoying.
There are no errors thrown on the PHP page, and nothing in the errors logs for the site either.
Does anyone have any ideas of where to look/figure this one out?
The topic ‘wp.uploadFile not returning struct’ is closed to new replies.