<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Uploading asset 500 error (was boundary issue)</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=" />
  <subtitle>Uploading asset 500 error (was boundary issue)</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=</id>
  <updated>2013-06-19T19:49:26Z</updated>
  <dc:date>2013-06-19T19:49:26Z</dc:date>
  <entry>
    <title>RE: Uploading asset 500 error (was boundary issue)</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5561081" />
    <author>
      <name>Tim Mori</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5561081</id>
    <updated>2012-05-04T23:23:23Z</updated>
    <published>2012-05-04T23:23:23Z</published>
    <summary type="html">Okay, answering my own post. Apparently the 500 error is caused by either the data not being formatted correctly (I had one character with the wrong capitalization), or the headers are messed up. 

I was using python, so I switched to using the poster module and let it set the boundary and content-length and it worked. The server still gave a 500 error for any media library item that didn't have a file size associated with it, but it added it anyway.

Essentially, I needed to migrate from an old DMM to a new one, but the published migration plan didn't work for me. Since I only needed the data from the Media Library, I just used the APIs to output from one and input into the other.</summary>
    <dc:creator>Tim Mori</dc:creator>
    <dc:date>2012-05-04T23:23:23Z</dc:date>
  </entry>
  <entry>
    <title>Uploading asset 500 error (was boundary issue)</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5554745" />
    <author>
      <name>Tim Mori</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5554745</id>
    <updated>2012-05-03T21:27:49Z</updated>
    <published>2012-05-03T04:07:06Z</published>
    <summary type="html">There's at least 3 different posts where people ran into this issue and I didn't see that anyone posted a resolution. I'm attempting to do this in python and I'm getting the boundary error.
 

&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;ns2:result xmlns:ns2="http://www.cisco.com/dms/xml/ns/dsmCommonService" xmlns:ns3="http://www.cisco.com/dms/xml/ns/historyManagement"&gt;&lt;status&gt;failure&lt;/status&gt;&lt;code&gt;Internal Server Error&lt;/code&gt;&lt;description&gt;Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found&lt;/description&gt;&lt;/ns2:result&gt;


I am using multipart/form-data as my content-type. If I add some generic boundary, e.g. setting 'Content-Type': 'multipart/form-data;boundary=abc123', the boundary error goes away, but the 500 server error remains.


So far there are posts where this has happened in PHP and Java, and now I can't get it to work in Python, so it's seems to be an issue on the DMM end. Is there an explicit boundary to use?
 
Edit: I think the boundary error is a red herring. Going by several different examples, I just set a dummy boundary and that error goes away. However, I cannot upload anything programmatically to the DMM. And I'm not even uploading a file, just a URL. Everything I've tried gives me a 500 error. I can add them using the HTML form though. I think the problem may be that the API requires a multipart/form-data encoding and I'm not really uploading a file, just data. This should work fine using text/xml or some other basic content-type.</summary>
    <dc:creator>Tim Mori</dc:creator>
    <dc:date>2012-05-03T04:07:06Z</dc:date>
  </entry>
</feed>

