Invalid file type "application/csv"

Your software
My Mautic version is: both 4.1.2 and 4.2
My PHP version is: 7.8
My Database type and version is: 5.7.37

Your problem
My problem is:
When I try to import a CSV I had this error in the UI:

Invalid file type “application/csv”. Use a file that matches one of the following mime types: “text/*”, “application/octet-stream”.

I have the same problem if I load a file that worked before and if I export a lot of contact and re-load it within mautic.

I don’t have it if I load a cvs file made from scratch.
I have the problem if I copy and paste the data from one file to another empty. I can’t understand…

I don’t have these problems if I load one of this files to other mautic instances

These errors are showing in the log:
mautic.WARNING: PHP Warning - Trying to access array offset on value of type bool - in file /…/app/bundles/PageBundle/Entity/HitRepository.php - at line 276

mautic.ERROR: Invalid clickthrough value: Yjo4Ontm…== {“exception”:"[object] (Mautic\CoreBundle\Exception\InvalidDecodedStringException(code: 0): The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:8:“fzbvy”;v:4;v:742;}f:8:“fzbvy”;v:742;f:7:“fgbg”;f:55:“954a695862fdb926861964”;f:7:“yfbe”;f:9:“455425”;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:742;}} is not a serialized array at /…/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"}

Solved:
The problem is with PHP 8.x. With PHP 7.4 all work fine

I am facing a similar issue now with php8.0.

I do not want to have to downgrade to 7.4 just for this and I am sure there is a setting or something that will fix this. Any suggestions ?

With 4.4.3 I don’t have any issues, have you the last Mautic version? Otherwise I have no ideas sorry

Hi,

with clickthrough values always also check if value you are trying to decode is valid base64 string.

The error above suggests invalid in base64 encoding. In previous versions of mautic (the ones that @antonio-lazzari is using) there were additional checks to make sure string is valid base64 encoded string.

Clickthrough value must be serialized array encoded in base64 string, if the array is incomplete or corrupted the decoding will fail - and you will get error as above.

Yes I was working with 4.0.1 and it was not working. I have upgraded to latest version and it is working (4.4.2), however I am seeing some weird behaviour where it is not brining in company name and creating new company