Hello. I am new to this forum. I am not a web developer, but I am willing to learn. I am a network tech. So here is what I need to do: I need to be able to list and sort by date some files in a folder on another page. I also need the file names to be hyperlinked to the actual file so that the people can download the file.

Our emergency preparedness director will release press releases and put them in a folder. I need this page to update every time he puts something new in. I already found some code that will do everything that I need to do, except put the hyperlink back to the file. The code that I found can be seen here: http://www.aspfaqs.com/ASPScripts/PrintFAQ.asp?FAQID=118. I have also attached the code in a txt file to this message.

If anyone can tell me what I need to do to get hyperlinks to work, I would appreciate it. Thank you.

Rusty Painter
rpainter@dorchestercounty.net

Could you not just modify...

fname = fileItem.Name

To read

fname = "<a href=http://downloads.com/myfiles/>" & fileItem.Name & "</a>

This won't work if you have sub directories ;)

Here's the error that I get when I try that.

Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/test.asp, line 58, column 97
fname = fname = "<a href=http://localhost/myfiles/" & fileItem.Name & ">" & fileItem.Name & "</a>

My folder is in the root of the web. Any sugestions?

I noticed that I had fname = in twice. I took one out. The only thing that that change is now the error is on column 89.

You're missing a closing quote mark at the end of the string. Try:
fname = fname = "<a href=http://localhost/myfiles/" & fileItem.Name & ">" & fileItem.Name & "</a>"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.