On OJS3, we cannot upload the cover image for a new issue. Here’s our journal manager:
“I seem to have run into an issue where the cover image for an issue fails to upload properly. Here are a few screenshots of what happened. In short, I was able to drag and drop the .png file of the cover, and it seems to upload, but then when I click “Save” I get an error message saying that only .png .jpg or .gif files are supported (which does not make sense since I uploaded a .png file). I have tried this repeatedly with a .png and also a .jpg and get the same error message each time. Do you have an idea of what might be causing this issue?”
Most likely OJS is having trouble getting the MIME type of the uploaded PNG file, which it uses to ensure that the file is actually the type that’s required. Search this forum for MIME and you’ll find related threads with suggested solutions.
Regards,
Alec Smecher
Public Knowledge Project Team
Which of our applications are you using, and what version? (Please include this information in your posts.) Is your problem occurring when you try to upload an issue cover, or something else?
Regards,
Alec Smecher
Public Knowledge Project Team
Are you sure the issue is the MIME type configuration? That hasn’t changed between OJS 3.0.2 and 3.1.0-1. It’s much more likely that the problem is something else, like file permissions in your files_dir if they somehow got changed during the upgrade.
Regards,
Alec Smecher
Public Knowledge Project Team
I have facing the same problem as well. I try to commenting mime_database_path = /etc/magic.mime in config.inc.php but doesn’t work. I try go to Cpanel on my server journal and select PHP extensions fileinfo which my default PHP extensions the extension is not selected. After I select fileinfo extension the problem solved, I successes upload cover image. Might someone there try this.
When I updated to 3.1.1 this also broke for me. However, I had also updated my PHP version. My ISP installed MultiPHP Manager, which allows you to run a distinct version of PHP by domain. I set OJS to use PHP version 5.6x (ea-php56). I also disabled PHP-FPM for my OJS domain (the latter is supposed to improve performance). After all of that, I set the following in config.inc:
mime_database_path = /etc/mime.types
“Magically” it started to work again. The joke here is that the default value of /etc/magic.mime had to be changed to get it to work properly. Note that your site will not function for a minute after you change the PHP version. If you don’t have MultiPHP Manager installed yet, I highly recommend it.
Iam using OMP 3.1.2.4
Nginx Server
PHP 7.4.x
fileinfo extensions enabled
uncomment mime_database_path = etc/mime.types in config.inc.php
.
.
cover files fails to save … and upload
How to fix it
Thanks a lot. My problem was solved.
config.inc
;[finfo]
;mime_database_path = /etc/magic.mime
Portugês:
erro ao fazer upload de capa para o ojs.
Comente as linhas acima.