metaWeblog.newMediaObject
Uploads a file to your webserver. If successful, the method will return a URL to the newly created file. Otherwise, a fault will be returned.
Parameters
- String blogid
- String username
- String password
- struct file
Return value
- URL to the uploaded file.
Notes
The struct file should contain two keys: base64 bits (the base64-encoded contents of the file) and String name (the name of the file). The type key (media type of the file) is currently ignored.

Comments
Where do the files go on the server?
When I call this method from my client I get an error message: Server returned a fault exception: [1] Error making path ”: mkdir : No such file or directory at /blog-mt/lib/MT/FileMgr/Local.pm line 105
This is using the Yahoo hosted version of MT (3.2).
Posted by: Tone
|
September 26, 2006 6:56 AM
The answer is that file.name does need to include a server relative path such as “/images/test.gif”.
The second thing I missed in the documentation is that the return value does need to be a struct with a single string property “url”.
The data (“bits”) does need to be Base64 encoded on the wire, but your xml-rpc library may take care of that for you.
Posted by: Tone
|
September 26, 2006 1:39 PM