ASP to display image rather than text path ??

D

david

Hi,

I have asp pages running from a MySQL database.
I have placed a path in the required field (although not quite sure on
the correct format).

My asp page is just displaying the text path instead of the image.
I'm using response.write.

The Folder is called : images
This folder is within : wwwroot\works\images\image1.jpg

How should I display this in the MySQL field ?
I have the field as type: VarChar

How do I display image1.jpg on my asp page ?

Appreciate your help

Thanks

David Gordon
 
A

Aaron Bertrand [SQL Server MVP]

Well, the image path *on the web* is probably /works/images/image1.jpg, so
that is what you should enter.

Now, I don't know exactly how you're retrieving this value from MySQL into
your ASP page, but once you have the value, you just say:

<img src="<%=imgPath%>">

Hopefully you see why this will not work if the imgPath =
wwwroot\works\images\image1.jpg
 
B

Bob Barrows [MVP]

Hi,

I have asp pages running from a MySQL database.
I have placed a path in the required field (although not quite sure on
the correct format).

It should be a url to the file.
My asp page is just displaying the text path instead of the image.
I'm using response.write.

The Folder is called : images
This folder is within : wwwroot\works\images\image1.jpg

How should I display this in the MySQL field ?
I have the field as type: VarChar

How do I display image1.jpg on my asp page ?

Appreciate your help

Thanks

David Gordon

<%
dim img
img=<content of recordset field>
%>
<html>
<body>
<IMG src="<%=img%>">
</body>
</html>


Bob Barrows
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top