Then make sure that private-files is tagged with the same label. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. How to set up permissions for the private files directory? Ask Question. Asked 3 years, 4 months ago. Active 3 years, 3 months ago. Viewed 7k times. I'm trying to set up the private files directory and I'm getting the following error. Improve this question. Are you running drush as root? That's not going to help because any files created by drush will not be writable by the webserver. Better to run it as the daemon user to reduce the chance of file ownership issues.
Sorry but that would be much too broad for a single question in this format. There are many different environments with many different considerations, too many to cover in a couple of paragraphs. File permissions are file permissions at the end of the day - Drupal just needs to be able to write to two folders public and private , and read from the rest of the docroot.
To put it succinctly: this is a file permission problem, not unique to Drupal, and we wouldn't teach you what you want us to teach you here how to manage generic file permissions on any platform. Ok I give : I've edited into the more generic version - like I said before, I can't promise that's not going to make it attract "too broad" close votes if I wasn't a mod and didn't have a binding vote I'd be voting it as such if I'm honest.
Thanks Clive - I appreciate your efforts, and those of other long-time users, in keeping quality here high. I plan to help edit the Drupal docs page once I have a bit more clarity ideally with similar help in making sure my edits are accurate and useful. Show 9 more comments. Active Oldest Votes. Improve this answer. I'm editing my original question to include this info. Hi Clive - I notice you rolled back my edits, and I understand your doubts about this question broadly.
Seems useful to me to include the changes mentioned here as an update to my question. Would doing so still be in keeping with the guidelines of the community?
OwnSourcingstudent — I'm considering it, or to update the docs on drupal. But I guess I won't have the time until later this day or tomorrow. Add a comment. Yeah, that's what I tried first. How should that ever work when your private files path exists outside Drupal's web root in a directory where Drupal has no write permission for?
So what can be wrong? Free Radical Free Radical Thanks for this detail, free-radical. Great explanation, and strikes me as a likely explanation, but sestatus returns SELinux status: disabled. Interested whether there's another buried detail that similarly bears checking. I agree: SELinux is disabled.
That rules out SELinux as the culprit. Unfortunately, I cannot think of any other things that may cause this. Things to try: 1 Contact bitnami support and user forums; 2 Go over your configuration again, look for spelling errors and other trivial mistakes; 3 ditch your vhost - start from scratch. Going over your description agian, I see nothing wrong in the way you've tried to set this up. By default with the core implementation, it is meant to be used with file upload fields.
Sometimes a use case comes up though where certain files within editor content need to be made private as well. It's not enough in this case to just have all the files that are private outside of the body text and listed at the bottom of the page in a list for example. There are benefits of maintaining files in separate fields from a content type setup point of view, but not always, especially when there needs to exists tight coupling of surrounding content and the need to mix public and private file systems.
The normal workflow when setting up private files using fields is to first enable private files in settings. Then you can start to configure file upload fields to be private in their settings within each content type.
Note here that the folder called "private" has been set as the root of the private file system. Any sub-folder structure is maintained. Please note that a true private file setup recommends putting the private folder outside of the document root. That is outside the scope of this setup and doesn't speak to the need for mixing public and private files.
Usually when you upload files using IMCE, the file paths used and inserted into the editor are just the literal paths. There is no facility in place for handling files coming from private folders. But since it doesn't, it presents the first problem we need to solve. The way we've handled this is to create a custom output filter to convert known private paths into Drupals internal file access route. This is easy since it's just converting the first part of the path.
Any nested folders maintain their structure as mentioned above. The other common type of filtering you might have seen is with "shortcodes". These are a popular concept in Wordpress whereby a content editor can use custom tags to effect the output.
Now that this is in place, the files that should be considered private will go through Drupal to check if the user has access or not.
0コメント