Private file system, The upload directory private://webform/XXXX/_sid_ for the file field could not be created or is not accessible I am trying to set up the private file system for drupal 8. I have created a private folder /home/user/public_html/private_files with permissions set to 777

in settings.php i uncommented the $settings['file_private_path']= '/home/[USERNAME]/public_html/private_files';

the .htaccess file was created.

the status report page gives:
File system
Writable (private download method)

When i try to upload a file with either the webform file field or a drupal file field i get the error message: File could not be uploaded.

In the error log i get:
The upload directory private://webform/XXXX/sid for the file field could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.

Can anyone help me with this
Your path must exist outside of your webroot directory and be an absolute path, for example: /var/www/private )

Also check PHP configuration


file_uploads = On must be set to "On"
upload_max_filesize = 24M can't be larger than post_max_size
max_input_time = 300 small values may cause timeouts for large file
uploads
memory_limit = 64M small values may cause out of memory errors for
large file uploads
max_execution_time = 180 small values may cause timeouts for large
file uploads
post_max_size = 24M limits the size of input submitted to the website
(including attached files)


Information is taken from here.