Protecting files download

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Erich le Ghaz
Forum Members
Forum Members
Posts: 32
Joined: Wed Feb 07, 2007 2:55 pm
Location: Germany

Protecting files download

Post by Erich le Ghaz »

Hi,

I installed FrondEndUsers and CustomContent modules and created a protected page where I placed a link for a file to download. Everything is worlking fine.

Now I tried to protect the file from direct download. I read the forum and tried a .htaccess file with

Deny All
Allow from 127.0.0.1

It worked. Direct access wan't possible any more. Unfortunatly the access via the website was denied too :C

What's wrong?

Thanks in advance.

Christian
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Protecting files download

Post by tsw »

use uploads module for the download link
User avatar
Sy
Forum Members
Forum Members
Posts: 95
Joined: Fri Aug 17, 2007 11:13 am
Location: UK

Re: Protecting files download

Post by Sy »

Deny All, means just that...prohibit anyone and everyone.

Allow from 127.0.0.1 means that only users of the local system would be able to download, this means only users of the server, no remote connections.
monghidi

Re: Protecting files download

Post by monghidi »

My .htaccess file reads like this:

Code: Select all

SetEnvIfNoCase User-Agent "^$" locally_linked=1
SetEnvIfNoCase Referer "^http://www.your_site_name.com/" locally_linked=1
Order Deny,Allow
Deny from all
allow from env=locally_linked
It is located in a directory called "secure" off of "uploads". Seems to work for me in conjunction with FEU and CustomContent. I found it on this forum a while back but can't recall where  ;)

If I'm logged in as a FEU user, the downloads work. If not, they don't.

Try this maybe?

Sorry, forgot to mention that the links to the files only appear on the page if you are a logged-in FEU user.
User avatar
Erich le Ghaz
Forum Members
Forum Members
Posts: 32
Joined: Wed Feb 07, 2007 2:55 pm
Location: Germany

Re: Protecting files download

Post by Erich le Ghaz »

Hmm Uploads module is no big help I suppose. I installed it, created a category, uploaded a file and... it was still accessible with an direct link.

Maybe I forgot something?
Last edited by Erich le Ghaz on Sat Oct 20, 2007 5:42 pm, edited 1 time in total.
User avatar
Erich le Ghaz
Forum Members
Forum Members
Posts: 32
Joined: Wed Feb 07, 2007 2:55 pm
Location: Germany

Re: Protecting files download

Post by Erich le Ghaz »

monghidi,

your htaccess is not working, too. I put it under uploads/protected, but could still download the mp3-file with an direct link.

Christian
Pierre M.

Re: Protecting files download

Post by Pierre M. »

Hello Christian,

tell more about your hosting context : provider, OS, versions, settings...

Pierre M.
Post Reply

Return to “CMSMS Core”