Closed (fixed)
Project:
Webform Protected Downloads
Version:
6.x-1.0-rc3
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2011 at 17:54 UTC
Updated:
24 Jul 2012 at 21:01 UTC
Jump to comment: Most recent
Comments
Comment #1
berliner commentedPlease make sure that the private_upload module is configured correctly. I can access the protected file using the url to the default file directory: http://www.rea-corp.com/drupal/sites/default/files/private/Architecting%...
Do you have any other node access modules installed that might interfere with the access control of the given files?
Comment #2
pirmin commentedAlso, make sure the (webform) page itself has been published.
When logged in, I'm able to go through the entire process even though the webform page itself hasn't been published. I'm obviously the owner of the (webform) page in question.
When the page hasn't been published, anonymous users will get the body from the Protected Downloads (Thank you for interest...) however won't be able to actually download the file unless the respective (webform) page has been published.
It's a bit counter-intuitive when one encounters this because one would expect the page with the hash (for which the url shares the same prefix as the otherwise unpublished webform url) to already generate some kind of Access Denied error.
When [webform_id] hasn't been published:
* http://www.example.com/node/[webform_id]/download/[hash] is available for everyone
* http://www.example.com/system/files/private/attachment is available for the owner of [webform_id] however produces Access Denied for anonymous.
Although the process works fine for published pages, it would be more consistent if the access denied is already generated when anonymous accesses http://www.example.com/node/[webform_id]/download/[hash] whenever [webform_id] hasn't been published since one would expect the permissions of the body of Protected Downloads to be governed by the permissions of http://www.example.com/node/[webform_id]
Comment #3
berliner commentedGood point on the access denied for unpublished webforms! I completely agree on that and changed the code to make it that way. Just committed it.
Comment #4
pirmin commentedThanks for the quick commit berliner. I bumped into the situation in the middle of last night. It's such a corner case that really won't manifest itself when the form is published but does arise when testing the unpublished form. I'm logged in editing the (unpublished) webform using Firefox, receiving the download email and then trying the link using an anonymous session from Chrome wherein the situation manifests itself.
It took me a couple of minutes to conjecture what was going on which is considerably less time (several hours) to realize that safe_mode doesn't interact nicely with private uploads. I hope this information can be of help for others.
Thanks for the protected download module. It seems to be functioning just fine over here.
Comment #5
emerygjr commentedThe link to the document from the download page is:
http://www.rea-corp.com/system/files/private/Energy%20Procurement%20Risk...
which gives access denied.
If the link is changed to:
http://www.rea-corp.com/sites/default/files/private/Energy%20Procurement...
Where /system/ is replaced with /sites/default/
You can test from: http://www.rea-corp.com/original
Comment #6
berliner commentedThe document should not be accessible using the direct path (sites/default/files/private) so it seems to me, that you didn't follow all the necessary install steps from the private_upload module. Please try to correct this and see if the problem still persists.
Comment #7
Anonymous (not verified) commentedSame issue here.
I don't say this is a bug, I am just following this thread. This module can solve a lot of problems for me if I can get it going, it's a great idea.
I created a webform, attached a file (a small jpg), checked it as protected, published the webform.
The link is emailed to me, and I can access the download page as anonymous, but when I try to download, I get this:
you do not have permission to access the requested resource
An authorized user *can* download the file.
Anonymous user has permission to access node content, and that's all. Does anonymous need some other permission?
- - -
BTW when I attach the file I do get a few strange messages like:
warning: Parameter 2 to webform_protected_downloads_form_alter() expected to be a reference, value given in /Library/WebServer/Documents/mysite/includes/common.inc on line 2892.
and
warning: Parameter 1 to theme_private_upload_form() expected to be a reference, value given in /Library/WebServer/Documents/mysite/includes/theme.inc on line 656.
I don't know if those messages are relevant.
The attachment uploads to the right place (files/private).
-rw-rw-r-- 1 _www _www littlefile.jpg
Comment #8
berliner commentedThe anonymous user also needs the "view uploaded files" permission.
No idea for the warnings though. What version of drupal is this?
Comment #9
Anonymous (not verified) commentedOK that fixed it, thank you so much for that quick reply!
[It's Drupal 6.20. I just ignored those messages and kept going. If it happens again I guess I should start a separate thread.
Meanwhile I will try a bigger form and bigger attachment.]
Comment #10
mfbPlease try the patch on this issue: #1179064: Cached access denied page at system/files/private/... (making sure to clear your cache). I wasn't sure this bug was the same as no one mentioned caching, but maybe so as the page cache is only for anonymous users.
Comment #11
berliner commentedclosing this old issue