Create a link to a specific file in a directory

Results 1 to 2 of 2

Thread: Create a link to a specific file in a directory

  1. #1
    Join Date
    Dec 1969

    Default Create a link to a specific file in a directory

    I&#039;m no great asp expert so I don&#039;t know how easy this can be done....<BR><BR>I have a website which I update every day. The new files I create are all in a directory called "Archive" on the server and all the files are created in numerical order by using the date of update, ie: <BR><BR>todays file would be 20030524.htm<BR>yesterdays file would be 20030523.htm<BR>etc....<BR><BR>I use "include" to put the html archive files in my default.asp page.<BR><BR>What I would like to do is at the top of the page have a link which would link to the previous file in the archive from the page I am currently viewing, ie: If somebody opens the page today, then the link would go to yesterdays update... if they then clicked and viewed the link for yesterdays update then they have tho option to click the link again and view the previous days update, etc....<BR><BR>I know if i list all my files in a database then this would be easy but I don&#039;t want to have to update a db everyday...<BR><BR>because the files are named in numerical order I&#039;m sure there must be a way of doing this in asp...<BR><BR>Many thanks in advance if you can help me...<BR><BR>Scotty....<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Create a link to a specific file in a director

    &#060;a href="filedir/&#060;%=date()-1%&#062;.htm"&#062;Previous&#060;/a&#062;<BR>?<BR>something like that idea, anyway. just subtract a day from date() (assuming your files are all in sequential order by days)<BR><BR>~~Chaotix<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts