XMLRPC/mw_newMediaObject – Large files give request status of 0
I am using the Blogger APIs via xmlrpc.php to try to post files to my blog via a widget I’ve written. Basically, you drag & drop a file, and it posts to the blog. I send an XMLHttpRequest calling metaWeblog.newMediaObject, sending my file as a base64-encoded string. This works fine for small files such as images, and even smaller videos. But I’ve run into problems when uploading large video files (5-10MB in size).
I’ve traced this down, and the file gets successfully written to the server, but for some reason the XMLHttpRequest status is 0 instead of the expected 200.
I’ve spent 3 days tweaking server settings, and have increased all the timeouts, execution time, memory limits, size limits, etc in PHP and Apache, and none of that helped. Like I said, the file successfully saves to the server, so I know it works, but why won’t XMLHttpRequest return the proper status of 200?
I’ve been beating my head against this wall for 3 days, so any help/advice would be greatly appreciated. Thanks!
To elaborate, here is the XMLHttpRequest response I am expecting. This is from a smaller file (500k):
<?xml version="1.0"?> <methodResponse> <params> <param> <value> <struct> <member><name>file</name><value><string>mvi-9148.avi</string></value></member> <member><name>url</name><value><string>http://www.mydomain.com/wp-content/uploads/2008/06/mvi-91482.avi</string></value></member> <member><name>type</name><value><string>video/avi</string></value></member> </struct> </value> </param> </params> </methodResponse>
But when I send a larger file (5-10MB), I don’t get any XMLHttpRequest response at all, even though the file is successfully uploaded and saved to the server. When I check XMLHttpRequest.status in my app, it is set to 0.
Does the metaWeblog.newMediaObject return any data when this happens? Normally you’d get an XML-RPC response with file, URL and type data.
That was it!! I’m using Konfabulator for my widget, and the default XMLHttpRequest.timeout is only 60 seconds. I upped this to 4 minutes and now the large files are successfully posting. I don’t know why I didn’t think of that… probably because my brain has turned to jello after 3 days on this. Thanks so much. 🙂
- The topic ‘XMLRPC/mw_newMediaObject – Large files give request status of 0’ is closed to new replies.