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

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.