I have a Drupal site that accepts private file uploads from some authenticated users.

The directory where those files are stored is privatefiles and it is located above the www directory, at the same level than the public_html directory. In the file system, the private file system path is defined as "../privatefiles"

That seems to work well.

I But I am transferring the site to another hosting company and putting it there as an add on domain to an existing one. The uploaded private files are no longer visible.

To make the add on site, I had to create another directory. The new directory is example1.com/example2.com If I move the private file directory one level down (i.e. under the public_html directory, then the private files become visible again.)

The only problem is that those files are now accessible from the web.

Does anyone know why this is so? How can I keep the private files at the same level? Should the "../privatefiles" be written differently? Or is this issue a limitation imposed by the new hosting company?

Any pointer for this would be greatly appreciated. :)

1 Answer 1


OK, I figured out what was going on and how to fix it.

The problem was indeed with the "../privatefiles" declaration for the private files directory. Just like for the old DOS files, the "../" means "one level up" and that is okay when the core file are in the www directory.

But when they are below or way below, the "../privatefiles" has to be replaced with the full path: "/home/whatever/privatefiles"

Now it works well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.