U
Umeshnath
Hi,
I need to download an image in my WCF Service. I am getting an image from
another “aspx†page by client POSTing the page using multipart form-data.
Posting aspx page
<form id="form2"
action="http://localhost:8080/services/cardservices/card/image" method="post"
enctype="multipart/form-data">
<input type="file" id="Text1" />
<!-- <input type="text" id="Text2" name="shippingaddress.lastname" />
<input type="submit" />
</form>
I think I supposed to get the image as a stream.
Below is my C# code
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/card/image")]
Activation TestImage(Stream stream);
public Activation TestImage(Stream stream)
{
MemoryStream ms = (MemoryStream)stream;
System.Drawing.Bitmap b =
(System.Drawing.Bitmap)Image.FromStream(ms);
b.Save(@"c:\two.bmp");
}
In my app config the base uri is http://localhost:8080/services/cardservices
Do I need to set any configuration setting to achieve this functionality?
Please help me to figure out.
Thanks in advance
Regards
Umeshnath
I need to download an image in my WCF Service. I am getting an image from
another “aspx†page by client POSTing the page using multipart form-data.
Posting aspx page
<form id="form2"
action="http://localhost:8080/services/cardservices/card/image" method="post"
enctype="multipart/form-data">
<input type="file" id="Text1" />
<!-- <input type="text" id="Text2" name="shippingaddress.lastname" />
<input type="submit" />
</form>
I think I supposed to get the image as a stream.
Below is my C# code
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/card/image")]
Activation TestImage(Stream stream);
public Activation TestImage(Stream stream)
{
MemoryStream ms = (MemoryStream)stream;
System.Drawing.Bitmap b =
(System.Drawing.Bitmap)Image.FromStream(ms);
b.Save(@"c:\two.bmp");
}
In my app config the base uri is http://localhost:8080/services/cardservices
Do I need to set any configuration setting to achieve this functionality?
Please help me to figure out.
Thanks in advance
Regards
Umeshnath