WordPress.org

Ready to get started?Download WordPress

Forums

XMLRPC/mw_newMediaObject - Large files give request status of 0 (5 posts)

  1. afx114
    Member
    Posted 6 years ago #

    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!

  2. afx114
    Member
    Posted 6 years ago #

    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.

  3. Joseph Scott
    Member
    Posted 6 years ago #

    Does the metaWeblog.newMediaObject return any data when this happens? Normally you'd get an XML-RPC response with file, URL and type data.

  4. Joseph Scott
    Member
    Posted 6 years ago #

    Any chance your Javascript XHR code is timing out?

  5. afx114
    Member
    Posted 6 years ago #

    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. :)

Topic Closed

This topic has been closed to new replies.

About this Topic