I have been provided with an ashx “service” that returns an image. I’m new to ashx files – so don’t know how to handle it.
I need to stream the image into a byte[] so I can copy it somewhere else. How do I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use WebClient.DownloadData pointing to asxh.
So let me give you a sample. Let’s say you have image located on asp.net page, like this:
In this case you can use following code:
Alternatively you can use WebRequest