[wp-trac] [WordPress Trac] #26318: XMLRPC wp.uploadFile fails to place media in sub blogs
WordPress Trac
noreply at wordpress.org
Fri Nov 29 12:02:40 UTC 2013
#26318: XMLRPC wp.uploadFile fails to place media in sub blogs
--------------------------+-----------------------------
Reporter: daki-san | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: XML-RPC | Version: 3.7.1
Severity: normal | Keywords:
--------------------------+-----------------------------
Using an XMLRPC call to mw_newMediaObject, uploaded files do not land in
the media library of the target blog, for example blog_id 2. The uploaded
files always land in the wp-content/uploads/yyyy/mm folder. And they also
appear in the media library for that blog too, via the UI.
If you trace the blog_ID to class-wp-xmlrpc-server.php you can see the
method is receiving the correct value (eg. 2) at that point.
This affects (at least) a subdomain-type of installation. The htaccess is
standard from the WP codex.
Occurs when blog_ID is passed to the rpc thus:
{{{
require_once 'IXR_Library.php';
$client = new IXR_Client('http://my-site.com/xmlrpc.php');
$params = array('name' => 'imgfile.png',
'type' => 'image/png',
'bits' => new IXR_Base64($bits),
'overwrite' => false);
$client->query('wp.uploadFile',2, 'admin', 'password', $params);
}}}
The xmlrpc returns a packet containing this data:
{{{
array (
'id' => '30',
'file' => 'test2_889047515_2.png',
'url' => 'http://my-site.com/wp-
content/uploads/2013/11/imgfile.png',
'type' => 'image/png',
)
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/26318>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list