Forums
This topic is locked
How to reference images outside of the DB.
Posted 31 Jan 2002 06:14:34
1
has voted
31 Jan 2002 06:14:34 Edgar Lagmay posted:
Hi,Seeking help how to reference dymanic images stored in a separate directory but whose file names are NOT present in any field/column of the database---i.e., there's no field in the db that stores either the filename or the path to the images. There are thousands of records and of course the corresponding images, so manual input is out of the question. Each record in the db are uniformly identified with a number, ex. A12345, and the associated image file is A12345a.jpg, and so on.
Someone suggested I create the reference on the page itself but I tried it and doesn't work. I tried creating a separate RS with just the record's unique number in it and used it as the data source for the image and I appended the "a.jpg" at the end of the URL string but didn't work.
Would be grateful and appreciate any help. Thanks.
Ed
Replies
Replied 01 Feb 2002 14:38:57
01 Feb 2002 14:38:57 I Mahomed replied:
Try
------"
Dim ImageURL
ImageUrl = "/images/" & (rsImages.Fields.Item("ID".Value) & ".jpg"
<Img Src ="<%=ImageUrl%>">
------"
Replied 01 Feb 2002 20:23:35
01 Feb 2002 20:23:35 Edgar Lagmay replied:
Thank you.
However, only the first image which belongs to the first record is displayed for ALL the other records as well. Images associated with other records do not display. Do I need to add something to your code?
Really appreciate your suggestion. Many thanks.--Ed
However, only the first image which belongs to the first record is displayed for ALL the other records as well. Images associated with other records do not display. Do I need to add something to your code?
Really appreciate your suggestion. Many thanks.--Ed
Replied 01 Feb 2002 22:20:39
01 Feb 2002 22:20:39 Viktor Farcic replied:
Place code Disorder wrote inside of repeating region.
Viktor Farcic
TalkZone Manager
Viktor Farcic
TalkZone Manager
Replied 02 Feb 2002 01:17:14
02 Feb 2002 01:17:14 Edgar Lagmay replied:
Would this be correct? If it is, I still get the same image for all the records. Thank you.
<pre id=code><font face=courier size=2 id=code>
<%
Dim ImageURL
ImageURL = "/folder/photos/" & (rsPhoto.Fields.Item("ID_NUM".Value) & "a.jpg"
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsPhoto_numRows = rsPhoto_numRows + Repeat1__numRows
%>
</font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code>
<%
Dim ImageURL
ImageURL = "/folder/photos/" & (rsPhoto.Fields.Item("ID_NUM".Value) & "a.jpg"
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsPhoto_numRows = rsPhoto_numRows + Repeat1__numRows
%>
</font id=code></pre id=code>
Replied 02 Feb 2002 11:58:08
02 Feb 2002 11:58:08 Viktor Farcic replied:
Do it this way:
1. Click on image
2. In code view you'll see code similar to this: <img src="ImageName.jpg">
3. Change it to: <img src="/images/<%(rsImages.Fields.Item("ID".Value)%>a.jpg">
Change it to match your folder and table name.
Viktor Farcic
TalkZone Manager
1. Click on image
2. In code view you'll see code similar to this: <img src="ImageName.jpg">
3. Change it to: <img src="/images/<%(rsImages.Fields.Item("ID".Value)%>a.jpg">
Change it to match your folder and table name.
Viktor Farcic
TalkZone Manager
Replied 02 Feb 2002 23:10:20
02 Feb 2002 23:10:20 Edgar Lagmay replied:
Thanks, Viktor.
I also did a little tweaking to concatenate the suffix for the jpg extension and it worked.
I noticed that if I use twice the same ID field item in the same recordset---as IMG SRC and as dynamic text display---the dynamic text does not appear on the page when viewed in browser. Is this a sharing violation?
--Ed
I also did a little tweaking to concatenate the suffix for the jpg extension and it worked.
I noticed that if I use twice the same ID field item in the same recordset---as IMG SRC and as dynamic text display---the dynamic text does not appear on the page when viewed in browser. Is this a sharing violation?
--Ed
Replied 03 Feb 2002 14:25:10
03 Feb 2002 14:25:10 Viktor Farcic replied:
You can use same recordset field as many time as you want. There's probably some part of the code that makes a mess that prevents you from displaying ID twice.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks, Viktor.
I also did a little tweaking to concatenate the suffix for the jpg extension and it worked.
I noticed that if I use twice the same ID field item in the same recordset---as IMG SRC and as dynamic text display---the dynamic text does not appear on the page when viewed in browser. Is this a sharing violation?
--Ed
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks, Viktor.
I also did a little tweaking to concatenate the suffix for the jpg extension and it worked.
I noticed that if I use twice the same ID field item in the same recordset---as IMG SRC and as dynamic text display---the dynamic text does not appear on the page when viewed in browser. Is this a sharing violation?
--Ed
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager