Click here to Skip to main content
14,644,614 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am developing a windows mobile application for uploading a image to webservice and retrieving the image from webservice by using c#.
my webservices contain two methods they are...

[WebMethod]
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
[WebMethod]
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}

in my application one picture box and two buttons for upload and download.
i added references to webservices also. i don't know what code to write on upload n download button for uploading and downloading image.
help me out..

[Edited]Code is wrapped in "pre" tags[/Edited]
Posted
Updated 28-Feb-11 18:16pm
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

In addition to Abhinav answer you can also go there-[Upload any type of File through a C# Web Service][^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

This[^] article might help you.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

this[^] article might also help you.
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

wrwerew<big>were</big>
werwrewr
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100