Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In Drupal 7, it was possible under admin/config/media/file-system to set the "Public file system path". This setting is no longer available from the UI in Drupal 8.

In Drupal 7, it was also possible to change this by setting $conf['file_public_path'] in settings.php. In Drupal 8, it is now called $settings['file_public_path'].

If you changed this setting in Drupal 7 then before upgrading you need to add

$settings['file_public_path']  = 'path/to/the/files/directory';

to your settings.php file.

Impacts: 
Site builders, administrators, editors
Module developers

Comments

s.zababurin.v’s picture

Hi
I have on production project on Drupal 8 where i have public file system path sites/default/files

How can i change this path in Drupal 8 and dont rebuild project ?

And when i choose $settings['file_public_path'] = /home/myFiles

it is folder creationg on path /home/cms/web/home/myFiles

How can i useing system path outside the project ?

grumpydev74’s picture

The path is relative to the Drupal installation folder, which is in your case "web"

In your case you want something like : $settings['file_public_path'] = '../myFiles'

So your final path to the files folder will be : /home/cms/myFiles

brad.bulger’s picture

file_public_path has to be set to something that is actually inside the docroot. it gets used in file URLs and any leading '..' components are trimmed away, becoming eg 'https://my.website/myFiles/image01.jpg'. which doesn't exist. if the files are in a directory outside the docroot, you can use a symlink to access them. eg make sites/default/files a link to ../../../myFiles.