Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WINMOBILE uploading a file from C# to a php webservice

I need to upload a file using C# from a windows mobile app to a website. It's running PHP as the webservice on the other side, though I guess it really doesn't have to if there's another way to be able to get the file up there. There is no server-side ASP support, however. My problem really isn't the PHP, it's the mobile C# code.

Also, System.net.WebClient does NOT exist in the compact framework, so unfortunately, that simple solution is gone.

Let me apologize in advance, because I know this is a relatively commonly asked question, but I just can't seem to find an answer. I've spent an unseemly amount of time on this one particular problem with no solution, so any help at all would be greatly greatly appreciated. Thanks a lot!

like image 643
Matthew Avatar asked Nov 18 '25 21:11

Matthew


1 Answers

Have a look at this article Improving .NET Compact Framework HTTP Communications using HttpWebRequest and Custom ASP.NET Providers in MSDN. It is specific for ASP technology, but the Compact Framework remains the same. Basically it uses an HttpWebRequest with a PUT method. If you aren't allowed to do so in the server, you need to create a sequence of POST requests yourself and handle them accordingly.

like image 193
kgiannakakis Avatar answered Nov 20 '25 12:11

kgiannakakis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!