Sorry that I am new to Drupal and I hope this question is not silly to ask. How do I create a download page with restriction to different groups? I tried hard but I can't find any. I am puzzle on how drupal.org create the download page which is very nice. Could anyone advise me. thanks.

Comments

killes@www.drop.org’s picture

In order to do that you first need to set the download option to "private".

And then you'd need to write a module that restricts the users' access based on their roles by implementing the _file_download hook.

For inspiration see here:
http://drupaldocs.org/api/head/function/upload_file_download
http://drupaldocs.org/api/head/function/fileupload_file_download

petertan’s picture

Thanks for the information. But what if I want different files to be access by different group? Such as contributor group which access to premium download while normal user access to public areas?

petertan’s picture

Hi, I have understand a bit of displaying in private and public...but one question, how do you attached a file which is already in your server? for example, you have \home\files\max.zip in your server... and it is 50MB. I don't think I want to reupload it thru attachment function.

magico’s picture

Version: 4.6.0 » x.y.z
Component: other » upload.module
Category: support » feature

Taking this idea a bit further, the "upload" module could give an option to "associate" the same file to different nodes.
For example, I create a node and attach a file. Then I create another node and I want to refer an already uploaded file. What do you think?

magico’s picture

Status: Active » Closed (fixed)

Closing in favor of this one.