Describe the issue or problem
I had a problem when I wanted to upload a file. I have tried several methods, such as changing the file path, but it doesn’t work. Please help to resolve this problem. Thank You
Is your directory for uploaded files (files_dir in the config.inc.php configuration file) configured inside your web root? If so, that is a dangerous configuration and will get your server hacked! (It’s very likely it already has been, looking at this message.) The files_dirmust be placed somewhere that it can’t be accessed directly through the web server. See the configuration form, configuration file, and e.g. Admin Guide for details.
Regards,
Alec Smecher
Public Knowledge Project Team
; Complete path to directory to store uploaded files
; (This directory should not be directly web-accessible)
; Windows users should use forward slashes
files_dir = /home/xxxxxxxx/public_html/ojs-binacipta/File
Is there anything in the configuration above that needs to be fixed? Please help. Thank you
Yes, that’s a dangerous configuration! The files_dir should not be set to something inside public_html. Move it outside of public_html and then update the files_dir to point to it.
Regards,
Alec Smecher
Public Knowledge Project Team
; Complete path to directory to store uploaded files
; (This directory should not be directly web-accessible)
; Windows users should use forward slashes
files_dir = /home/xxxxxxx/ojs-binacipta
but HTTP Error still appears. is there any other solution? Thank You
That’s probably a file permissions problem (judging by the error message you posted above). Make sure your file permissions are set so that OJS can upload files into the directory you’ve configured.
Regards,
Alec Smecher
Public Knowledge Project Team
I have setup the file or folder permissions according to what you suggested, but I can’t upload it yet and there is still an HTTP Error notification. the permission I use is 0777. is there another solution? Thank You
If you see an error message in your logs like the one above:
Unable to write file at /path/to/file/here
…it means that file permissions aren’t correct. There are a number of threads about this in the forum, but I can’t give specific help because the permissions you need to set will depend on your server’s configuration. If you’re using a server that runs SELinux, for example, you might need to set some additional permissions.
Note that 777 permissions are never safe to use in production, though they can be useful for debugging.
Regards,
Alec Smecher
Public Knowledge Project Team