[support] Fine-grained control over file download

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Mon Aug 15 02:15:21 UTC 2011


Dear all,

I'm looking for a way to have more precise control over file download
permissions than what is achieved by the Upload module in D6.

What I need:

1. Some of the uploaded files should be downloadable by everybody, but some
others should be downloadable only by one or some roles.

2. When a user has not yet logged in, he/she should see what's there to be
dowloaded for the eligible users.
When following the download link, the login screen should appear, and the
dowload be allowed if it turns out that the user has an appropriate role.

What I tried:

1. Looking the drupal modules tagged with File management. Didn't find
anything relevant.

2. With the filefield module, I created a field especially for the files
whose download is supposed to be restricted. I added that field to a content
type and allowed only one role to view that field. But that does not work as
needed, because when a user is not logged in, the available files are not
even shown. And moreover, assuming a user could guess the right URL to use,
I'm pretty sure he/she would be able to download the file without the system
being able to make sure the download is legitimate.

Any suggestion would be more than welcome.

Best wishes and kindest regards,
Sébastien.


More information about the support mailing list