Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

In addition to Abhinav answer you can also go there-[Upload any type of File through a C# Web Service][^]
 
Share this answer
 
This[^] article might help you.
 
Share this answer
 
this[^] article might also help you.
 
Share this answer
 
wrwerew<big>were</big>
werwrewr
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900