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 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    92
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Must be logged in for downloading

    I have a form where logged in users can upload a file to a folder. I want to make it so they can restrict access to downloading this file -so only logged in users can see the link to download the file.

    But of course, if someone isn't logged in and happened to come across the url of the file, they can download it. Is there anyway to make it so that files can't be downloaded unless the user is logged in?

    I came across a thread that said the only way to do something like this is to make it so the files are uploaded to mysql. Is this really the case and if so, does anyone know how this is done?

    Thanks in advance for any help.

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,130
    Thanks
    2
    Thanked 328 Times in 320 Posts
    Is there anyway to make it so that files can't be downloaded unless the user is logged in?
    Yes, read this - http://www.codingforums.com/showthre...116#post811116
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Tags for this Thread

    Posting Permissions

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