ASP 101 - Active Server Pages 101 - Web05
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
(<OBJECT> vs. Server.CreateObject())
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Store Image Paths, Not Images

One of our visitors sent in the following e-mail about handling images with a database.

Rather than including an image in a database I tend to store just a filename. Keeps the file sizes small.

So in a staff page the image is displayed:

<img height="100" src="images/<%= rstSimple.Fields("photo").Value %>" alt="<%= rstSimple.Fields("name").Value %>">

Or, if you prefer, the photo field could contain the full URL.

Have also used an asp page to create a page of thumbnails of all images in a folder using the FileSystemObject - handy for digital photography.

Regards,
Andrew

You're absolutely right Andrew. For most projects, the additional overhead and work involved in storing the actual images in the database just isn't worth it. Especially when just storing the location is so much simpler and generally performs better too.

For those of you who are interested in something similar to Andrew's thumbnail page idea, you might take a look at our An ASP Image Browser (and Killer!) article and our Filtered Directory List sample. Both of them use code that could very easily be tweaked and used to browse digital photographs.

Thanks go out to Andrew Johnson for sending in this tip.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers