There is any script for static url for file?

Discussion in 'PHP' started by MyLibary, Jun 23, 2010.

  1. #1
    MyLibary, Jun 23, 2010 IP
  2. SNo

    SNo Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    you should :
    1. make a token for each user that visit download page, you should use a random algorithm.
    2. save it somewhere (database, session, ...)
    3. write a code (for example : download.php) to check the token and serve the file to user
    4. make rewrite rule (htaccess or ...) to say webserver to run download.php?token=abcd1234&file=test.exe when user request example.com/abcd1234/test.exe
     
    SNo, Jun 23, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    For what purpose you need that!
    The current helps you to prevent hot linking :)
     
    roopajyothi, Jun 23, 2010 IP
  4. MyLibary

    MyLibary Well-Known Member

    Messages:
    693
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Since i give service that just after someone feel something he get a file.
    I dont want that someone will do it and give the url for everyone, thats why im asking for help!
    Marco.
     
    MyLibary, Jun 24, 2010 IP
  5. esearchZac

    esearchZac Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    did you meant you need an dynamic url to be generated for every download
     
    esearchZac, Jun 24, 2010 IP
  6. clox.c

    clox.c Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    clox.c, Jun 24, 2010 IP