control file downloads through apache

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
rameshmrgn
Forum Newbie
Posts: 15
Joined: Sat Jun 17, 2006 1:01 am

control file downloads through apache

Post by rameshmrgn »

Is it possible to control file downloads in apache?

how to do?


Smiles,
Ramesh Mu
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post by Mordred »

What do you mean by "control" ?
There is the .htaccess/.htpasswd mechanism for access restrictions on folders and files

If you want rapidshare-style downloads, you can generate a unique path and copy the file for download there, and after some timeout delete it.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Second from the botton in our Useful Posts Thread
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post by Mordred »

The trouble with fpassthru() is that download managers will not work with that url, unless you're ready to go and re-implement major parts of the HTTP server protocol ;)

If you don't care about download managers and continuing of broken downloads, it's fine.
Post Reply