Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have added the directory '/' and enabled the the role 'anonymous user'.
When I try to open an image by using the url http://example.com/system/files/image.jpeg, I get an 'access denied' for 'system/files/image.jpeg'.
Any ideas?
Comments
Comment #1
rida.fatima CreditAttribution: rida.fatima commentedMake sure your directory has the required permissions, if you are using linux go with 777 or 775 and see if you can view the images now
Comment #2
Chipie CreditAttribution: Chipie commentedThank you for the prompt reply.
The permissions are set correctly.
When I login to the site, I can see the image. Only anonymous can't see it.
Comment #3
rida.fatima CreditAttribution: rida.fatima commentedhmm...so have you set the permissions for the anonymous user to see the image at admin/people/permissions ?
Comment #4
Chipie CreditAttribution: Chipie commentedI have enabled the following permissions for anonymous user under permissions:
File entity:
Bypass file access control
Image: Download any files
View private files
Private files download permission:
Bypass Private files download permission
Did I miss something?
Comment #5
Chipie CreditAttribution: Chipie commentedI have enabled the following permissions for anonymous user under permissions:
File entity:
Bypass file access control
Image: Download any files
View private files
Private files download permission:
Bypass Private files download permission
Did I miss something?
Comment #6
zanonmark CreditAttribution: zanonmark commentedHi Chipie,
first, I think you should not "bypass Private files download permission" for anonymous users: unless you know what you are doing, it generally poses security threats.
Please report me:
* the full schema of your Private files download permission directories;
* the path of your media directory.
Thanks,
Marco
Comment #7
zanonmark CreditAttribution: zanonmark commentedComment #8
ktrev CreditAttribution: ktrev commentedHi,
I am having the same issue.
I want anonymous users to access one directory called 'assignments' in the private folder
The private folder has permission 777 recursively.
In the modules configuration page, I have added /assignments and enabled role anonymous users.
But I am getting access denied, for the path http://sitename/system/files/assignments/Lab6_2_4.txt, for anonymous users.
(Please inform, if you need more information)
Thanks in advance :)
Comment #9
chrisgross CreditAttribution: chrisgross commented[deleted] (never mind)
Comment #10
jm_drupal CreditAttribution: jm_drupal commentedHi
I am getting 'Access denied' error msg for Admin users while trying to download private files.
Few settings:
Drupal version 7.26
admin/config/media/file-system
private file system path: /var/www/sitename/sites/default/private
Default download method set to : Private local files served by Drupal.
admin/config/media/private-files
folder_name -> [Logged in Users] selected
admin/config/media/private-files-download-permission
Default was: /var/www/sitename/sites/default/private => Added "/private_folder_name" in the box
/private_folder_name -> enabled the user and administrator role
Folder permission set to 775 recursively
.htaccess within the private folder:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Deny from all
Options None
Options +FollowSymLink
Private file URL, eg.: http://sitename/system/files/private-folder-name/filename.pdf
Administrator has full permissions to the site. Still i get 'Access denied' when try to view/download any private files.
Any ideas? Thanks for your time in advance.
Comment #11
zanonmark CreditAttribution: zanonmark commentedHi jm_drupal, and sorry for the late reply,
"private_folder_name" and "private-folder-name" are two different paths: are you sure there's no mispelling in the test you made?
Thanks,
Marco
Comment #12
zanonmark CreditAttribution: zanonmark commentedHi ktrev, sorry for the late reply,
still getting that error, even with the latest version? and only with anonymous users?
Thanks,
Marco
Comment #13
zanonmark CreditAttribution: zanonmark commentedComment #14
Miao1994 CreditAttribution: Miao1994 commentedHi
I'm reporting the following. I need that an anonymous user can download a file (place in a subdirectory of the private file system) attached to a node, having the specific link. So, creating the node with private file field the link is like this (of course):
https://xxxxx/system/files/folder1/folder2/filename1.pdf
Then I did that:
1-Add that path /folder1/folder2 to private file download permission config, setting user anonymous and role anonymous;
result: access denied
2-Give permission to anonymous user to create/edit the content type attached to the file;
result: access denied
3-Give “Bypass Private files download permission” to anonymous user;
result: access denied (log: Anonymous not verified system/files/folder1/folder2/filename1.pdf)
4-For more info, test download for other private file like: https:// xxxxx /system/files/folder1/folder2/filename2.pdf (in this case uploaded by IMCE, serving private file disabled);
result:access granted (log: User 0 (-) granted permission to download uri "private:// folder1/folder2/filename2.pdf ".
Revoking step 3, step 4 failed: access denied. Seems the module control access to private file but not those attached to a node.
Adding “Bypass to Enable to make this module ignore the above path”, as expected, seem not have effect.
Have advices?
Thanks