Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am trying to develop my website in ASP.NET which takes in pictures from user's, stores them in SQL Server 2012 and displays them when they visit Photos page, and only working approach I found online was to read byte[] stream of data from SQL Server and converting it to Base64 and then displaying via DataURI specification. Since some websites can show multiple images that are cached and don't need to be re-downloaded, so I wanted to know how do I implement caching of images on client side, some approach that doesn't use data uri and still works? Any suggestion/idea would be appreaciated.
Posted
Updated 16-Sep-14 0:30am
v2
Comments
Thomas Nielsen - getCore 17-Sep-14 3:06am    
First of all, if you have the time, consider storing something else than the image in the database?
Images are big things and you may discover that when space begin to run low on your database server, that the tables taking up space is pictures.
Were you to store the location on your fileserver or webserver of the images you will see that the browsers are anyway caching the images and the access time will naturally get faster.
Generally it is not recommended architecture to store binaries in RDBMS
Akshay Raut 18-Sep-14 2:22am    
@Thomas Thank you, could I trouble you for one more thing? Can you provide me with aspx.cs code for FileUpload control that saves images with unique names and how do I determine if these images are large or small, that's another problem I am unable to solve because large images are filling up the screen. It will be enough if you can just explain the logic. Thanks again for that idea. I'm gonna try that for sure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900