I have to get image of a user from his device and save it on to a server folder using WCF.
How to do it. I hvae been using the below mentioned code. But its not morning no error no warning and neither success.
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "UpdateUserImage",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped)]
String UpdateUserImage(Stream fileContents);
public string UpdateUserImage(Stream fileContents)
{
string result;
string FilePath = ConfigurationManager.AppSettings["TemplatePath"].ToString();
System.Drawing.Image img = System.Drawing.Image.FromStream(fileContents);
img.Save(FilePath + "\\mypics.Jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
result = "Image ";
return result;
}
Can i get one good working example as all the one's i searched in open forums didnt get any lead.
I am using Net framework 3.5