File upload is not working

Dear community,

the file upload is not working on my installation. See the screenshots
upld

Here is what I have in my error logs

[Mon Sep 06 12:52:16.284958 2021] [php7:warn] [pid 20] [client 172.18.0.3:59920] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312
[Mon Sep 06 13:29:35.459916 2021] [php7:warn] [pid 21] [client 172.18.0.3:59964] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312
[Mon Sep 06 13:30:46.569500 2021] [php7:warn] [pid 18] [client 172.18.0.3:59982] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312
[Mon Sep 06 13:31:39.543615 2021] [php7:warn] [pid 49] [client 172.18.0.3:60126] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312, referer: https://trud.test.igduran.ru/index.php/psu/ma$
[Mon Sep 06 13:31:39.543674 2021] [php7:notice] [pid 49] [client 172.18.0.3:60126] PHP Notice:  tempnam(): file created in the system's temporary directory in /var/www/html/lib/pkp/classes/file/TemporaryFileManager.inc.php on line 90, referer: htt$
[Mon Sep 06 13:31:39.543781 2021] [php7:warn] [pid 49] [client 172.18.0.3:60126] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312, referer: https://trud.test.igduran.ru/index.php/psu/ma$
[Mon Sep 06 13:31:39.543838 2021] [php7:warn] [pid 49] [client 172.18.0.3:60126] PHP Warning:  move_uploaded_file(/app/public/files/temp/pngpPeDNm): failed to open stream: No such file or directory in /var/www/html/lib/pkp/classes/file/FileManager$
[Mon Sep 06 13:31:39.543859 2021] [php7:warn] [pid 49] [client 172.18.0.3:60126] PHP Warning:  move_uploaded_file(): Unable to move '/tmp/phpBHBAKC' to '/app/public/files/temp/pngpPeDNm' in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on$
[Mon Sep 06 13:33:09.955977 2021] [php7:warn] [pid 99] [client 172.18.0.3:60136] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312
[Mon Sep 06 13:33:54.064814 2021] [php7:warn] [pid 19] [client 172.18.0.3:60140] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312, referer: https://trud.test.igduran.ru/index.php/psu/ma$
[Mon Sep 06 13:33:54.064888 2021] [php7:notice] [pid 19] [client 172.18.0.3:60140] PHP Notice:  tempnam(): file created in the system's temporary directory in /var/www/html/lib/pkp/classes/file/TemporaryFileManager.inc.php on line 90, referer: htt$
[Mon Sep 06 13:33:54.065019 2021] [php7:warn] [pid 19] [client 172.18.0.3:60140] PHP Warning:  mkdir(): Permission denied in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on line 312, referer: https://trud.test.igduran.ru/index.php/psu/ma$
[Mon Sep 06 13:33:54.065078 2021] [php7:warn] [pid 19] [client 172.18.0.3:60140] PHP Warning:  move_uploaded_file(/app/public/files/temp/pngJBNHbc): failed to open stream: No such file or directory in /var/www/html/lib/pkp/classes/file/FileManager$
[Mon Sep 06 13:33:54.065113 2021] [php7:warn] [pid 19] [client 172.18.0.3:60140] PHP Warning:  move_uploaded_file(): Unable to move '/tmp/phpPjEcGF' to '/app/public/files/temp/pngJBNHbc' in /var/www/html/lib/pkp/classes/file/FileManager.inc.php on$

Application Version - 3.3.1.0

Will appreciate your help.

Thanx

Hello @Vladislav_Mavrin … It seems that the problem is caused by incorrect file permissions.

You may wan to check that the “files” directory configured in OJS is accesible and writable by the webserver.

@hilongo Thank you!
I found
files_dir = /app/public/files in config
changed to
files_dir = /var/www/files
Now seems to work

1 Like

Hi @Vladislav_Mavrin,

Please make sure that your files_dir isn’t inside your web root, so that malicious users can’t formulate URLs to access its contents directly. See docs/README.md under “Recommended Configuration” for details.

(For some servers, /var/www is the web root; for others, it’s /var/www/html.)

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

This is so helpful and it solved the problem

This topic was automatically closed after 4 days. New replies are no longer allowed.