In one of my previous article, I wrote about – how to upload PDF, DOC, PPT files in MediaWiki. But when I uploaded a PDF file, MediaWiki thrown an error message as “The file you uploaded seems to be empty. This might be due to a typo in the filename. Please check whether you really want to upload this file“. If you come across this error, then here’s the solution.
- It seems like PHP or web server that powers MediaWiki has an issue. Probably a limitation.
- Check if PHP configuration file (php.ini) has upload_tmp_dir property set. If not, you need to set it to a temporary directory such as ‘/var/www/html/wiki/temp‘ and give permission for the web server user to write into it.
- Restart the web server and see if you can upload files properly.
Getting a different error this time? Something like ‘An error was encountered when opening the file for ZIP checks‘.
Solution: Make sure ‘upload_tmp_dir’ is not pointing to ‘/tmp’. Try changing it to a directory other than /tmp and make sure it’s writable by ‘apache‘ user.
Read other articles on MediaWiki.
I love bugs and I love fixing them!