# Invalid file type "application/csv"

**URL:** <https://forum.mautic.org/t/invalid-file-type-application-csv/22891>\
**Category:** Product Support\
**Created:** [March 2, 2022, 4:21pm UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891 "2022-03-02T16:21:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio-lazzari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/antonio-lazzari/32/737_2.png) [@antonio-lazzari](https://forum.mautic.org/u/antonio-lazzari)\
**Post date:** [March 2, 2022, 4:21pm UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/1 "2022-03-02T16:21:54Z")

</div>

**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)"}

---

<div class="post-metadata">

**Author:** ![antonio-lazzari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/antonio-lazzari/32/737_2.png) [@antonio-lazzari](https://forum.mautic.org/u/antonio-lazzari)\
**Post date:** [March 3, 2022, 4:28pm UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/2 "2022-03-03T16:28:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [September 27, 2022, 9:32am UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/3 "2022-09-27T09:32:17Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![antonio-lazzari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/antonio-lazzari/32/737_2.png) [@antonio-lazzari](https://forum.mautic.org/u/antonio-lazzari)\
**Post date:** [September 27, 2022, 10:03am UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/4 "2022-09-27T10:03:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 27, 2022, 10:25am UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/5 "2022-09-27T10:25:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [September 27, 2022, 11:42am UTC](https://forum.mautic.org/t/invalid-file-type-application-csv/22891/6 "2022-09-27T11:42:13Z")

</div>

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
