Linking to JPGs on disk

S

SHB

I need to link to some staff images stored on a hard disk
using a database storing the path to the jpg file. Using
vbscript I thought this would work:

response.write "<p><img border='0'
src='file:///strSource></p>"

strSource being the path stored in the DB.

Unfortunately when I preview this I get the dreaded red x
and the path in the image property sheet shows as
file:///strSource not file:///c:\folder\image.jpg or
whatever the path is.
I know this is my syntax as hardcoding the path works but
I just cant seem to get it.
Can anyone help?

SHB
 
M

Murray

First of all, you don't want a <p> tag around an <img> tag. That's not good
HTML. So the code would be -

response.write("<img border='0' src='file:\\\c|\folder\" & strSource & "'
width='123' height='321' alt='' title='foo' >")

Would that work?
 
K

Kevin Spencer

It should also be noted that if this is a web site on a web server, and the
client is not using the same machine the files are stored on, you will get
the same red x, as the file doesn't reside on the file system of the client
machine. If so, you need to move the images into your web site, or create a
virtual directory in your web site that points to the folder containing the
images, and use HTTP links to the files.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
G

Guest

Hi,

Thanks that did work. I'm fairly new to this side of FP
programming and still getting a feel for how it works.
Yes the files are stored on a network share so that
shouldn't be a problem.

Regards
SHB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top