SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to dynamically create links to files that are being displayed from a directory?

    I'm building an app with Classic ASP that allows users to upload files to a directory. After the file is uploaded it reads the directory and displays each of the uploaded files to the user.
    That part I have working fine.

    The question is, how do I create a dynamic link to each of those files after they are uploaded so others can download them?

    Can anyone show me a simple example?

  2. #2
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is my code:


    Set FSO = Server.CreateObject("Scripting.FileSystemObject")
    Set AFolder = FSO.GetFolder(Server.MapPath("uploads"))

    For Each Item in AFolder.Files
    Response.Write "<font color=blue>" & Item.name & "</font>" & "<BR>"
    Response.write "&nbsp;" & Item.DateLastModified & "<BR>" & "<BR>"
    Next

  3. #3
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind, I figured it out.

  4. #4
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post your method of achieving your request? I think I would like to be able to have certain users upload files to a directory.

    Thanks,

  5. #5
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the string I wrote to get the links to the files working.

    Response.Write "<font color=blue class=para>" & "<a href=uploads/" & Item.name & ">" & Item.name & "</a>" & "</font>" & "<BR>"


Bookmarks

Posting Permissions

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