Stream Image

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I have an image which is being returned to me as a MemorySteam. I want to
dislpay this out onto the browser. Is the below all I should need to do?

ThumbnailData.WriteTo(Response.OutputStream);

Just that there are no images appearing.

Thanks,

Jon
 
You should set ContentType, for example:

Response.Clear();
Response.ContentType = "image/jpeg"; // Change to appropriate content type

And I think you already know that you have to use this page for the sole
purpose of displaying this file.
 
Jon,

You need to make a separate page called, say, GetImage.aspx. The page will
accept a query parameter with meaning "image id". In the places where you
need to specify an image url put something like
ImageUrl="GetImage.aspx?id=xxx"

In GetImage.aspx retrieve the image by id and stream it down in
Response.OutputStream. It will land in exact place in the control that
ordered it in its ImageUrl property.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top