PDA

View Full Version : link


Baleric
10-04-2005, 07:02 AM
hey i got a dir listing and i would like to make it so wen u clikc the file it loads it in the browser eg.

Image.jpg loads to www....../image.jpg

here is my code im using, i got it from w3scools

<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("D:\BalericFINAL\Images")

for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br /> " )

next

set fo=nothing
set fs=nothing
%>

thanx -baleric

Bullschmidt
10-04-2005, 02:45 PM
Perhaps change this:

Response.write(x.Name & "<br /> " )

To be more like this instead:

Response.write("<a href='" & x.Name & "' target='_new'>" & x.Name & "</a>" & "<br />")

Or perhaps:

Response.write("<a href='http://www.mysite.com/images/" & x.Name & "' target='_new'>" & x.Name & "</a>" & "<br />")