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 a setup, where the private file system path is "outside", relative to the public path:
public: domain.xx/files
private: domain.xx/private/files
Is there anyway I can configure IMCE, so it will be able to show files from both "roots"? Or how can I set the root to be "above" the /files library.
My default file configuration is public.
Thanks
Comments
Comment #1
ufku CreditAttribution: ufku commentedYou can't set a root other than file system paths. You may access the files at separate urls like /imce/public, imce/private.
Creating symlinks could be a solution but Drupal does not support it currently.
Comment #2
mazaza CreditAttribution: mazaza commentedWould it be a viable support request "to make IMCE read from BOTH public and private path in admin/config/media/file-system" regardless of their path"
(And thereby not enforcing that private is a subdirectory of public)
Comment #3
stongo CreditAttribution: stongo commentedI would like to second this feature request. The proper "secure" setup of the private file system is to have it outside the web root, and with the current configuration pages of imce, this is impossible.
It might make sense to use the stream wrapper changes introduced in Drupal 7, and reference the file systems like:
"private://folder-name"
"public://folder-name"
Comment #4
jlongbottom CreditAttribution: jlongbottom commentedI second this. It is currently impossible to have a proper public/private file system with IMCE being configured to access both. I am quite surprised this has not been an issue for many other people. What does everyone else do?
Comment #5
star-szrHaving this same issue, closed #1700438: Why force IMCE to use default file system? as a duplicate of this issue.
Comment #6
thisisnotrealpeople CreditAttribution: thisisnotrealpeople commentedAlso wanting to see this resolved as it is very annoying to use ftp to upload files to a public dir
Comment #7
RobKoberg CreditAttribution: RobKoberg commentedme too. I want to have some files in the private file system (published book PDFs) and some in public (content images and videos).
I am going to need to switch to media and give that a try... ufff
Comment #8
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI also think this is a must.
How about making two different file explorers available ? Being two buttons in CKEditor or two tabs inside IMCE file explorer...
One public, that would display folders of the public root only and format urls that way: "sites/default/files/..."
One private, that would display folders of the private root only and format urls that way: "system/files/..." so that we can apply restrictions with other modules such as File Entity Permissions.
Comment #9
jelo CreditAttribution: jelo commentedI second #3. Currently trying to set up a site with private files and running into this issue...
Comment #10
deanflory CreditAttribution: deanflory commentedNeeding this too, didn't realize till now that I couldn't get into my public and private folders using IMCE and User-1. Hrrmmmmm....
Comment #11
leahtard CreditAttribution: leahtard commentedFor others coming across this issue, IMCE now has a setting at /admin/config/media/imce. Expand "Common Settings" and uncheck "Disable serving of private files".
Comment #12
seattlehimay CreditAttribution: seattlehimay commentedI'm running into this issue as well. My content admin should be able to upload files to either public or private space, but can't do this.
Comment #13
lokapujya"Disable serving of private files" allows you to basically have public files within the private files folder, but does not allow you to browse/upload files in the "public" folder.
Comment #14
bart atlas CreditAttribution: bart atlas commented"Disable serving of private files" obliterates file permissions. I have a site that uses OG to control access to nodes, and the nodes have files attached. File permissions work as they should, until I "disable serving of private files". Once I do that, every private file is available for download by anyone, anonymous or authenticated, who has the URI to the file. This checkbox is not a workable solution if you need to enforce access control.
See https://www.drupal.org/node/1174782 for related comments.
Comment #15
Christian DeLoach CreditAttribution: Christian DeLoach commented"Disable serving of private files" option does not related to the original posters request so I'd like to get this discussion back on topic.
"Working with files in Drupal 7" (https://www.drupal.org/documentation/modules/file) recommends choosing a directory located outside of the web root for private files, for example:
../private
However, the IMCE directory configurations are based on the "file system root" which I assume refers to the public file system path when the default download method is set to "Public local files served by the webserver" (see admin/config/media/file-system) so, currently, the only way to upload files to the private file directory defined by the private file system path (see admin/config/media/file-system) is if the private file directory is a descendant of the public file directory.
As the original poster requested and several others reiterated, it would be nice if there was a way of uploading files to the private file directory when the private file directory resides outside of the file system root.
Comment #16
karthiselvam.seeralan CreditAttribution: karthiselvam.seeralan commentedAny update on this?
Comment #17
herbiek CreditAttribution: herbiek commentedI have paid a Drupal company that created a popup screen for us that (when starting the IMCE browser) asks me first if I like to browse in the private or public file directory.
Comment #18
Christian DeLoach CreditAttribution: Christian DeLoach commentedCare to share the module with the Drupal community?
Comment #19
herbiek CreditAttribution: herbiek commentedI don't think this it is a module, but rather a piece of custom php software.
Comment #20
Christian DeLoach CreditAttribution: Christian DeLoach commentedTypically custom PHP code is implemented in the form of a Drupal module.
Comment #21
tkruger CreditAttribution: tkruger commentedAnyone else make any progress on this? I've tried another file manager but get the same result.
I have the Drupal default file system set to private but need IMCE to default to public file system. So that my clients can click the image icon and browse in the ckeditor and upload public files.
Comment #22
thallesSome news about this?
Comment #23
thallesMaybe this page can help: https://www.drupal.org/forum/support/post-installation/2016-08-21/how-do...