I am developing a Web application, where in I get some images and documents from an external source. These images and documents are stored in memory. Since there can be huge traffic on this Web site, it is not adviced to save it onto the disk, hence I want to show the in-memory images and documents on a asp.net web page. Can anyone guide me, how can we achieve this ?
One way I tried was using the custom web controls, I use to render the images as Response.BinaryWrite and same for documents in the custom control. But the content-type may differ for each image and the document. The solution worked, but is not a robust one, since some time it displayed and sometimes it doesnt
Comments are welcome !
Here are my two cents on this.
How do we display an image
we use <img.... href="xyz" />
what is important is what is this href? href is any URL it may be on disk it may be in memory or any other place.
Let us assume that the image may be referenced as
Now we need a CGI code or an asp.net handler or any code which understands this URL and returns back the image.
How do we acheive it ?
We write a code which gets this url
Based on the Id identifies the image
Sends back the Stream, now what is important is setting the content type which must be image.
Hope this helps.
Last Visit: 31-Dec-99 18:00 Last Update: 4-Aug-15 6:37