No file uploaded or invalid file type!

Working fine in local but not working in live server

Ok, I had the same issues with the “No file uploaded or invalid file type!” problem on a windows server.

To fix it, I had to add this php extension in php.ini
extension=php_fileinfo.dll

This seems to be the way php finds file type info on windows machines.

Hope this helps!

-James

3 Likes

hey Alec, I’m having the same issues here and couldn’t find a solution on the other threads suggested above. It could be something related to mime type or extension? If so, could you please tell me how to fix it? Thanks!

Hi @milach,

Can you describe what you’ve tried and what the result was?

Regards,
Alec Smecher
Public Knowledge Project Team

I’ve tried to add this to mime.conf and then to the virtualhosts section of the webapp:
AddType image/jpeg .jpg

I’ve also checked the permissions and everything seems fine, fileinfo support is enabled and I don’t get any errors on the apache error logs as well, just this “no file uploaded or invalid file type” when I try to upload a logo in the website’s settings.

This happened after the upgrade from 2.4.8 to 3.0.1.

Thanks!

Hey Alec, the issue seems to be resolved doing this…

[finfo]
;mime_database_path = /etc/magic.mime

in the config file.

Do you think that commenting it out could cause any trouble?

thanks again, man.

Hi @milach,

Commenting that setting out will cause FileInfo to rely upon its internal database, which should be fine.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher

i’m new in OJS 3.0

i already read all the FAQ and try to understand how to solve this problem… but i can’t.

i saw other friends here said issue has been resolved by adding MIME type and extension in CPanel. but i dont know where to add the MIME type and where to type. i found this in config.inc.php file…

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Fileinfo (MIME) Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[finfo]
; mime_database_path = /etc/magic.mime

but… what i should do next??

please help me

tq

Check with your hosting provider or your system administrator about either enabling support for FileInfo in PHP, or what the correct path to your magic.mime file is for your environment.

1 Like

i was searched but no magic.mime in my environment. so what should i do? still cant upload image.

@jonipauli, please give us some more details about your situation. What application version are you using and what kind of image are you trying to upload? What has your hosting provider or system administrator advised regarding the PHP Fileinfo module and your magic.mime settings?

Oh my mistake, my module wasn’t active. Thanks all.

Hi friends,

I have the same problem. I can not upload any image file (JPG, PNG, GIF, TIF) as Administrator.
I only get this message: No file uploaded or invalid file type!
My installation is new. I am working with OJS 3.0.2 in Linux.

Please, somebody help me.

Hi @santillan, I already encountered that problem. I just looked for extension=php_fileinfo.dll in my php.ini and removed “;”.

2 Likes

Please,

Could you indicate to me where is the php.ini file in OJS?

Thank you in advance for your help.

Hi @santillan, I think php.ini is located in your public_html.

Unfortunately I can not find it anywhere of my File Manager (I am using CPanel).
Do you know another solution?

Hi @santillan,

Have you tried the recommendations already in this thread (and in the FAQ)? What was the result?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I didn’t try the recommendations in:

https://pkp.sfu.ca/wiki/index.php/PKP_Frequently_Asked_Questions#HTML_Galleys_don.27t_display_properly_.2F_files_I_upload_aren.27t_being_identified_properly.

because it is not clear for me. I need an example to understand it.

Do you have some example?

Please!

Hi @santillan,

See also this forum FAQ. The issue is technical in nature, so you may need some PHP/server configuration skill to resolve it.

Regards,
Alec Smecher
Public Knowledge Project Team