Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a link to a file in a database

Status
Not open for further replies.

djcampos

Programmer
May 12, 2005
15
US
I have used Pure ASP upload in order to upload filenames to a database and the actual file to a server. I can create a recordset in which I can view the file name that has been loaded, but I would like to create a link in that recordset to the actual file residing on the database. Basically, I am creating a news page and I want the user to be able to click on the file name to download a copy of the PDF file that is associated with the file name. Can anyone help?
 
If you know the file name from the database and you know the location the file has been stored in just build up the link with asp, basic idea is below (untested)
Code:
<%
dim link, fileName, fileLocation
fileName = rsRecordset.Fields.Item("FileName").Value
fileLocation = "../route/to/the/folder/"
link = "<a href='" & fileLocation & fileName & "'>Clickey Here</a>"
%>
<%=link%>

Cheech

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top