Click here to Skip to main content

Sandeep Aparajit - Professional Profile

5,030
Author
53
Authority
77
Debator
5
Editor
1
Enquirer
56
Organiser
416
Participant
Sandeep has 7+ yrs of IT experience. He is Microsoft Certified Technology Specialist and has been certified for Analyzing Requirements and Defining Microsoft .NET Solution Architectures.
He is an active member of:
1. MSDN Forums
2. CodeProject.com
3. Community-Credit.com
4. Blogspot.com
 
You can find his contributions at:
My Blog
Photography
Member since Sunday, July 27, 2003 (8 years, 10 months)

For more information on Reputation please see the FAQ.
 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.5.120604.1 | Last Updated 4 Jun 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid

You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
  Refresh
QuestionHow to display in-memory images and documents in an ASP.NET page? Pin
Thursday, May 15, 2008 2:48 AM
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 Smile | :)
 
Comments are welcome !
 
------------------------------
Sandeep Aparajit
Mark usefull posts as Helpful/Answers.
http://sandeep-aparajit.blogspot.com

AnswerRe: How to display in-memory images and documents in an ASP.NET page? Pinmembergaurav_verma_mca19:58 23 Apr '09  
Hi
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
http://mylocation.com/Images?Id=1001
 
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.
Regards
Gaurav