[drupal-support] Download only for Authenticated users

Nicolas Tostin nicolast at logis.com.mx
Mon Sep 5 23:20:30 UTC 2005


> Hi, list.
>
Hi Claudio,

> I want to implement this feature in a site (some files only available to
> authenticated users), already saw how to protect a page
> (node_privacy_byrole module), and how to upload files (attachment module).
> I already saw a discussion of the exact same problem  (in
> http://drupal.org/node/23882), but my concern is that uploaded files are
> visible to anyone who knows the exact URL of the uploaded files (at
> least when I implemented it).
> Anyone can give me a direction to follow, even if a have to learn a bit
> of php?
>
you need two things :
1/ Enable private download using attachement module. By default it's not
possible to switch from public to private, be sure to read this
http://drupal.org/node/25889 and if you already got some files uploaded
you'll have to modify the tables by hand as with this method it's not
possible to have both public and private files. It's still very rough but I
gave my reasons in the thread.
Also be sure to to read all the open issues on attachment and filemanager,
there's some little bug corrected there.

2/ you need to add a perm more to filemanager module something like "access
files".
I made a little piece of code available threr : http://drupal.org/node/30468

Regards




More information about the drupal-support mailing list