Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post

    Question HTTP protecteded folders and php

    Hey just want to hear if anyone know if you can like protect a folder where HTTP authentication is required then put files in there and when on a site someone E.g. pays to download something then the php document Auth's and downloads it and how secure would this be?

    Thanks
    Last edited by diload; 02-02-2010 at 04:28 PM.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    yes, this can be done. lots of sites already do this. simply keep the files outside of the web root, then when some one pays for the download, stream the files to the client with a php function like this:
    http://www.awesomephp.com/?Tutorials...d-options.html

  • Users who have thanked angst for this post:

    diload (02-02-2010)

  • #3
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post
    So basicly I can use info provided at http://php.net/manual/en/features.http-auth.php to authenticate and then call a function to download the file?

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    no, I wouldn't use that. if your selling downloads then you would want to auth them with php/mysql. once payment is complete, trigger the download.

  • Users who have thanked angst for this post:

    diload (02-02-2010)

  • #5
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post
    Arh okay yea I get it got something working now so thank you very much


  •  

    Posting Permissions

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