No file uploaded or invalid file type!

Dear @asmecher

I applied the commit. But I can’t check whether upload works or not because now every time I hit upload it loads the image then say that I don’t have permission to do this change (logs out). This happens when I try to upload the logo or homepage image. If I try to upload an image in-text (e.g. under Additional Content) it says

Upload in progress… This is taking longer than usual.
An error may have occurred.

I have already uploaded an image to Additional Content before and it went smoothly.

Is it possibly related to web directory permissions? I am sorry to bother you with all of this. I started out all of this without any knowledge of web development (with the assumption that OJS is well-suited for non experts) and I am learning on the way.

ElHassan

Hi @elhassan,

Did you try disabling session_check_ip per my earlier suggestion? If not, please try that.

Alternately, you may be running into this logout problem, which I’ve asked a developer to take a look at. Watch that thread for an update. For some reason, this seems to happen more regularly with Internet Explorer than other browsers; if you’re using that, you could try another in the meantime.

Regards,
Alec Smecher
Public Knowledge Project Team

hi @asmecher, i still had problem like this, when i check my config of PHP, i see finfo enabled. but the problem still exist,the permission if upload even set to 777, and also why the header of modal box are showing null rather that uploads

Need support on this, I’m using VPS on CentOs with PHP 5.6

Adi Pranadipa

Hi @adipranadipa,

What directory are you setting permissions on?
Note that 777 permissions are never safe to use, though they can be helpful while debugging.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher After i did some workaround, the issues is resolved , thanks before

can you write how you resolved it?

I have the same issue and would appreciate your help if you found the solution.

Please tell, what things you have applied, so other may be benefited.

Please guide me how to resolve the issue, I installed OJS3 in linux server

Hi @pharmagp,

Have you tried any of the above advice?

Regards,
Alec Smecher
Public Knowledge Project Team

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?