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

rida.fatima’s picture

Make 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

Chipie’s picture

Thank 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.

rida.fatima’s picture

hmm...so have you set the permissions for the anonymous user to see the image at admin/people/permissions ?

Chipie’s picture

I 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?

Chipie’s picture

I 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?

zanonmark’s picture

Hi 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

zanonmark’s picture

Assigned: Unassigned » zanonmark
Status: Active » Postponed (maintainer needs more info)
ktrev’s picture

Hi,

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 :)

chrisgross’s picture

[deleted] (never mind)

jm_drupal’s picture

Hi
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.

zanonmark’s picture

Hi 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

zanonmark’s picture

Hi ktrev, sorry for the late reply,

still getting that error, even with the latest version? and only with anonymous users?

Thanks,
Marco

zanonmark’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Miao1994’s picture

Hi
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