Results 1 to 7 of 7

Thread: Download page using php and auto-link creator

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Download page using php and auto-link creator

    Hey,
    I have downloaded files from many webpages before. The main thing is that when I pushed Download, it redirected me to other white page, then showed save table, and when downloading begin it dissapered. And I thought tah I need sometjing like that. It would let download file by only users and noone will know the exact dirrection where I keep the file...

    If you understood what I want, help me. If you need more info, ask..

    Thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Just use php include (I think that should work). Or do:
    Code:
    header("Content-type: text/...");
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    What you mean include?

    I want to create a link which will dissapear after some time, so noone will use my files' links in their sites.

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    You could rename the file after every download, and only allow access to the pages if the users are logged in.

    http://php.net/manual/en/function.rand.php

    http://php.net/manual/en/function.rename.php

    You should store the original name and the being changed name somewhere though so you can keep track.
    Corrections to my coding/thoughts welcome.

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You should look at ways to block 'hotlinking', I think.

    Alternatively, create a php download page that grabs the file and serves it to the user. Use a database with random names. That way no one knows the real URL of your file. You can change things with that.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    But function rand changes only number... and if that link will be used in other file?

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I don't know what you mean post some of the code for what you're doing. I assumed you were using a database and that the link was being pulled from there on the referring page and the download page.
    Corrections to my coding/thoughts welcome.

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
  •