Sorry to post this "general" and undetermined title for this post.
I´ve been a while looking for an answer related to private and restricted uploaded files, and didn´t get the answer yet.

Not even at the IRC. Not here at the forums.
And I´m not the only one.

There have been several posts related to this stuff:

http://drupal.org/node/41175
http://drupal.org/node/68270
http://drupal.org/node/68297
http://drupal.org/node/68301
http://drupal.org/node/37719
http://drupal.org/node/68255
http://drupal.org/node/68252
http://drupal.org/node/68220
http://drupal.org/node/68225
http://drupal.org/node/46187
http://drupal.org/node/13553
http://drupal.org/node/26601
http://drupal.org/node/20329

I´ve started some of those, and I´ve participated in some others.
None of them with a solution.

Please let me be clear, as my mother´s tongue isn´t english maybe I´m sounding angry, or complaining, or something like that. But it is NOT. I´m very grateful with Drupal community! I could happily set my site because of your help!

I just desperately need a solution for this. And didn´t find it yet.
I´m passing to Drupal the whole site of my company, and found that one special and very important issue is unsolved: I need the ability to upload private files, and public ones. I din´t saw that problem before. I thought that controlling node and block access was enough.

As Drupal didn´t seem to be able yet to do this, I´ve tried to upload those files manually and call each file typing <a href=""> for each one. But as I´ve added an .htaccess file to protect that folder, those files cannot be downloaded anymore!!
It appears an error page "Not Found". It should appear a box asking for a username and a password.

So, I´m completely lost here.
Hope this topic can get the attention of somebody that could help me.

Thank you very much for your time and patience guys!

Rosamunda

[moved to support]

Comments

rubenk’s picture

This may help you a little bit in making sure you have files in a protected area and can properly administer access permissions. I hope it helps (it's a short post :)

http://drupal.org/node/62614

Sorry if this is taking you in the wrong direction.

Rosamunda’s picture

Thanks ruben... I´ve saw that and in fact it helped me to set a "private" folder specially thinking in the attachment module.
But I cannot "Force Private" in it. I dunno why, but It doesn´t save it.

I appreciate your link anyway :-)

I simply cannot belive that Drupal can´t handle this private issue in any easy way...
It must be a way to do this...

robertdouglass’s picture

Without reading through the list of issues that you linked to, I just wanted to assert that Drupal handles private/public file upload/downloads that respect node access permissions using the filemanager and attachment modules. You need to have a folder that Apache will not serve yet which is readable by the Apache user on your server (in mod_php settings). The server configuration options here play a very large role in whether you will succeed with this, or not. Given the number of different ways to run Apache, PHP, other web servers etc., it is impossible to give directions for every one's needs.

When you find the answer, PLEASE describe exactly what your challenging situation was (webserver configuration, how is PHP being run, etc.), what problems you had, and what the solution was. It is definitely possible to do what you are describing, but if you have an interesting server configuration, it may take more work.

- Robert Douglass

-----
My Drupal book: Building Online Communities with Drupal, phpBB and WordPress

Rosamunda’s picture

What information should I ask to my server to know what to do?

The Apache configuration as an issue, makes a lot of sense, because I´ve installed both modules and cannot set the Files folders to "force private" and that sounds like an apache problem.

Rosamunda’s picture

Update:

1= All the uploaded files are saved to the private folder, outside public_html. But the script accesses it and shows the files inside it to everyone.
2= When I click on the files this is the path that appears: mysite.com/mydrupalfolder/filemanager/active?fid=5
3= The path seems to be ok.
4= I cannot check the "Force Private" checkboxes. When I do and hit save, they are not saved, and those checkboxes appears unchecked again.
5= At "Access Control" I only have an option to the attachment module: "add attachments". There are no other options there, nor any options related to filemanager...
6= I´ve asked my server, and because of Nº 1= they say that is a script problem.

Rosamunda’s picture

Any idea of how can I manage this..?

Rosamunda’s picture

My server says the problem is the script, I couldn´t belive that...
But anyone has say nothing about this...
I´ve started an issue, posted maaaany topics...

I won´t give up.

Hope someone can help, or I see myself in the years to came still asking for this...

;-)

heine’s picture

A support request with N links but not much further content isn't my idea of fun (I'm not going to read them either). It's not even clear what THIS is. I personally believe it's better to just open one quality topic.

That of my chest; let's do some analysis.

On a recent 4.7 cvs checkout I've
- installed filemanager (CVS)
- installed attachment (CVS)
- set a directory inaccessible via the web as private files directory
- allowed users add attachment permission
- set Private files to enabled in administer » settings » attachment (admin/settings/attachment)

After looking at the docs and briefly checking the code, it's clear that attachment allows the download of the file when the user has 'view' permissions on the node.

That usually means anyone can download your private files via the filemanager/active?fid=1 url as long as they have the 'access content' permission. To test your configuration, make sure anonymous users cannot view the node with an attachment (for example by unchecking 'access content', then try to access the attachment URL as an anonymous user.

--
The Manual | Troubleshooting FAQ | Tips for posting | Make Backups! | Consider creating a Test site.

Rosamunda’s picture

First things first... THANKS VERY MUCH HEINE because of the time and truble that you´ve take to help me in this task.
You´re right saying that posting several links doesn´t help, nor it´s fun.
I thought it could be a way to show that I´ve been asking that for a while... but you´re right.

Anyway, and after a long time, YOU, (I´m sorry, I must say it again) YOU, HAVE SOLVED IT!.
THAT SIMPLE YET FUNDAMENTAL TINY LITTLE DETAIL that you refer at the last part of your post in fine, is the truly, real yet simple KEY of the whole problem.

So, THANKS THANKS THANKS. This stuff means a great deal to me, and it was a substantial part of my Drupal site.
And thanks for the stuff about how to post. I´m gonna make it clear next time.

So, after all this time, patience and work, mine and of all the people like you that have taked their time to try and help me with this, I finnally can move on this issue.

So, please allow me this little exertion (is that the word?) of happiness...

YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!YAYY!!!! haha!!!! yeahh!!! WOW!!!! hehe!!!

Thanks again.
Maybe it was a little effort to you, but it meant a LOT to me.

Rosamunda

spyres’s picture

That seemed to work for me also. I wanted to protect some pdf files for "members only" access, and your method seems to have done the trick!

Thanks for the heads up on this.

escoles’s picture

My $.02: Filemanager and attachment are inadequate solutions once the file size gets above about 2MB. And they're generally inadequate solutions if you are trying to implment a site that will be maintained by non-technical users.

For any access restricted site, it's imperative that you be able to restrict the ability to download files to logged in users. If that site will be distributing large files, it's also imperative that you be able to upload the files via FTP, rather than web forms.

I'm still struggling with whether it's possible to accomplish this in Drupal and end up with a solution that I can expect non-technical users to be able to use.

Rosamunde's problem adds another layer of difficulty: She seems to want to make some files public and some private.