[mono-android] System.Net.WebClient.UploadFileAsync Problem

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Thu Jan 19 17:27:56 UTC 2012


On Thu, Jan 19, 2012 at 12:07 PM, subsembly <a.selle at subsembly.com> wrote:
> Got me :-)

Hah. No, you got me!

>
> To my surprise your code does indeed add the MIME header stuff, even on the
> .NET Framework for Windows. So I went back to my real application code to
> check this out. I found the difference is that we are using "PUT" and not
> "POST" as the HTTP method.
>
> If you change your line to
>
> wc.UploadFileAsync (new Uri ("http://127.0.0.1:9000/"), "PUT",
> "uploadfile.cs", evt);
>
> then .NET for Windows does no longer add the MIME headers. Whereas, Mono
> still does.

I have just fixed the PUT problem in Mono master and updated the bug
report accordingly.

While the next release is being cooked, you now know that the
workaround is to use "POST" :-).

Thanks!

-Gonzalo


More information about the Monodroid mailing list