p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   Displaying photos via a database (http://p2p.wrox.com/showthread.php?t=40891)

Mike707 April 14th, 2006 08:54 AM

Hi Imar,

Its working!! :-)) You were right, the path stored in the databse should be //localhost/wwwroot/Barlows/Images/1.jpg and then it works perfectly! I owe you a beer man!

I've now got another question, but I'll put that as a new post as it's nothing to do with this topic.

Thanks again Imar!


Imar April 14th, 2006 11:24 AM

Before you send me that beer, you may want to consider the path you store in the database.

If you store something like /localhost in the database, on your machine things will work. However, this schema will break when you move your site to another machine and access it like http://www.yourdomain.com. In that case, localhost will no longer exist so your images will break.

That's why I suggested earlier to store images from the virtual root path.

So, if you browse to your site like this:


and you access an image like this:


then only store /Images/MyImage in the database. Once you move to YourDomain.com, you can still access the image with

http://www.yourdomain.com/Images/MyImage.gif where the italic part is the dynamic path from the database.

Hope this helps,

Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Mike707 April 17th, 2006 12:33 AM

Thanks Imar, that's usefull to know!

All times are GMT -4. The time now is 09:47 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.