Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, I'm making a personal website that will have some files to download. I've made all the system including a simple login with levels per account. Right now only "allowed" ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2012
    Posts
    115

    Debian, protect file from download.


    Hello, I'm making a personal website that will have some files to download. I've made all the system including a simple login with levels per account. Right now only "allowed" people can see certain downloads but if they go to the folder where the files are they can download it if they now the file name... How can I prevent that?


    Thanks, joaogl.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    how are you defining the access to the "allowed" people in web directory? for example, assuming you are using Apache web server, if you use simple .htaccess rules, that would prevent others from accessing the content of the directory, even if they knew the full URL to a file.

  3. #3
    Just Joined!
    Join Date
    Nov 2013
    Posts
    2
    I think you could create "wrapper script" for downloading different files and using account privileges. Files can be placed outside webroot so there's no way to download files directly.

  4. #4
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    Yes I'm using apache and I've thought of using .htaccess but I'm still not sure how to protect it using the account privileges...
    about the wrapper script I'm going to look into it. Thanks for the anwers

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Joaogl View Post
    Yes I'm using apache and I've thought of using .htaccess but I'm still not sure how to protect it using the account privileges...
    i guess it depends on what you mean by "account privileges"...

  6. #6
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    Data that given by the SESSION on php

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Joaogl View Post
    Data that given by the SESSION on php
    Perhaps you can try using an Apache Rewrite rule to redirect the requests to the dir (or files) to your auth PHP script. I'm not too familiar w/PHP auth, but this suggestion might be what you want.

Posting Permissions

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