Upload images to windows mobile 6 in .net

I am working on a mobile app in .NET. This is a Windows mobile application. I am facing a problem in this application that I want to upload an image / file to the specified url / server. Many loading classes are not used, for example Webclient,WebRequest,WebResponse

. I used HttpWebReques

, this is not a server connection.

Can anyone help me on how to load images to a given url in windows mobile 6 in .NET?

0


a source to share


3 answers


Not sure what you mean when uploading images to a given url. Of course you need some kind of listener or something on your server to get the image data.



You can create a .NET web service with a function that takes a byte [] input parameter to download your image data to your server and links that are contained in your Windows Mobile application.

0


a source


Can you change the server code? If so, there are several other options.

You can save images to a database (SQL Server Compact Edition) and then use Sync Services.



You can use WCF to transfer data (for mobile you have two WCF options, webservice and message ... you may need a message for that).

0


a source


The target server must have a web page that excludes the image when it appears. Open a file stream, load the image into memory into a byte buffer. Use fileinfo to get details such as length, which you will need later. Open the binary reader and read the image into the buffer. Open WebRequest. Create your url, set method to post, nice long timeout, request.content length for byte buffer length, open stream instance for your request.GetRequestStream () instance. for example, create a binary writer using a stream, write a filebuffer, close it, open a web response, run a stream reader in GetResponseStream, and check that the bytes received match what you sent. I found some good code at EggheadCafe when transferring data.

0


a source







All Articles