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

mime
invalid
upload

#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!
No file uploaded or invalid file type... while uploading logo, plugin, stylesheets
Issue cover fails to upload on OJS3
No file uploaded or invalid file type!
Issue cover fails to upload on OJS3
How do I import issues and articles from spreadsheet?
HTML in Galley not rendering (displays source instead)
Upgrade 9 y.o. OJS to OJS3
Upgraded to OJS 3.1.1 from OJS 2, getting "The file could not be uploaded or revised" errors
Any solution to No file uploaded or invalid file type
Error loading logo OJS v. 3.1
I have an HTML, with a CSS style shee
OJS 3 upgrade script crashing on large database
Upgrade to 3.1.1
#2