Error message on upload: "No file uploaded or invalid file type!"

mime
upload
invalid
Tags: #<Tag:0x00007f127193da20> #<Tag:0x00007f127193d818> #<Tag:0x00007f127193d638>

#1

This message has two common causes:

  • Uploads are failing entirely. Check to ensure that your PHP configuration permits uploads.
  • The upload is succeeding, but the software is having trouble ensuring that it’s the right type of file.

PKP software uses MIME types to ensure that e.g. uploaded logos are actually image files. There are several mechanisms that may be available to PHP to do this, depending on your server configuration:

OJS 3.x tries these in order, using the first mechanism it can.

If your PKP application appears to be failing to identify a file you’re uploading, ensure…

  • for images, that it is of an acceptable type. For images, .png and .jpg are preferred. .gif files are not currently supported; .png files are better for all uses except animation. Use a .png file for a favicon.
  • that the mime_database_path setting in your config.inc.php is correct. Commenting it out should cause the software to use an internal database.

If these don’t work, you may have to investigate your system’s configuration more closely, e.g. to determine which of the above functions is available. This will take some PHP expertise.

See also this wiki article.


Problem: No file uploaded or invalid file type!
Issue cover fails to upload on OJS3
No file uploaded or invalid file type!
No file uploaded or invalid file type... while uploading logo, plugin, stylesheets
How do I import issues and articles from spreadsheet?
I have an HTML, with a CSS style shee
Error loading logo OJS v. 3.1
Upgrade to 3.1.1
Upgrade 9 y.o. OJS to OJS3
HTML in Galley not rendering (displays source instead)
Issue cover fails to upload on OJS3
OJS 3 upgrade script crashing on large database
#2