From: Derek W. <dwe...@ct...> - 2012-04-10 16:09:16
|
Its a multipart form. Turns out this may be an BUG or limited feature set. As this post sugests that the C# library doesn't fill in the boundry types properly. When I use fiddler to watch the HTTP headers you can see that the library doesn't put an ending boundry entry. http://www.dzimchuk.net/blog/post/Uploading-a-file-over-HTTP-in-NET.aspx <http://www.dzimchuk.net/blog/post/Uploading-a-file-over-HTTP-in-NET.aspx> Here is what the failed post http headers show. Thanks Derek POST http:// <http://example.edu:8080/exist/rest/db/pcupdates/GNU2030CZ4/results.xml> example.edu:8080/exist/rest/db/pcupdates/GNU2030CZ4/results.xml HTTP/1.1 Content-Type: multipart/form-data; boundary=---------------------8cee52578b13d71 Host: example.edu:8080 Content-Length: 107828 Expect: 100-continue Connection: Keep-Alive -----------------------8cee52578b13d71 Content-Disposition: form-data; name="file"; filename="c:\batch\updates\results.xml" Content-Type: text/xml ��<�X�M�L�O�u�t�>� �.. ..lots of XML content here from the file being uploaded �X�M�L�O�u�t�>� � � End of headers _____ From: Dannes Wessels [mailto:di...@ex...] On Behalf Of Dannes Wessels Sent: Monday, April 09, 2012 4:17 PM To: Derek Werthmuller Cc: exi...@li... Subject: Re: [Exist-open] POSTing XML file using .NET C# Hi On Monday, 9 April 2012 at 21:50 , Derek Werthmuller wrote: byte[] responseBinary = client.UploadFile(url, fileName); what is used under the hood? PUT? Post/multipart-formdata? you might leave out the document-name from the URL in cause of POST/mpfd….. cheers Dannes |