3.1 Importer File type error
Hey team, I am trying to get this new inbuilt importer to work and is is hitting an issue where it wont accept any file type... even the generated example file.
I've have:
1. Upgraded to 3.1+
2. run the migrations
3. generated an import using --generate
4. downloaded the example file
5. filled in the data
6. tried to upload
7. tried both csv and txt(tsv)
I'm sure it is something stupid simple I am missing.
13 Replies
I see another user is having the same issue:
https://github.com/filamentphp/filament/issues/10732
GitHub
Filamentphp ImportAction - Unable to import .csv file - File of inv...
Package filament/filament Package Version v3.1.36 Laravel Version v10.40.0 Livewire Version ^3.3 PHP Version PHP 8.2.13 Problem description Cannot upload .csv file that is downloaded with download ...
What's the actual mime-type of the file?
I think we just need to add more mime-types for CSV as mentioned in the second comment.
Should just be a straight csv. I am using the latest version as well.
Oh wow... ok yes. It is totally just in Firefox that it is an issue.
Works in chrome and Edge.... that is odd and a huge PITA.
Hmm, I also have this issue. Not only on firefox, but also on Edge. On Edge its even doesn't provide csv file types to choose from (for upload)
I have versions Filament/filament 3.2.17 and pxlbrt/filament-excel 2.3.0
Using Nginx and php8.2-fpm
upload the file to a mime type checker
it's ok, I've reverted the the non batch/job back uploader (plugin). better suits my needs.
I debugged, that uploading csv from my windows pc the mime type is application/vnd.ms-excel
Is it possible to change it?
application/vnd.ms-excel is .xls not .csv
I know, but I created csv with vscode. and uploading this file, firefox response is application/vnd.ms-excel..
Even try to upload the importers example file, the same 😦
I guess, in windows registry is some kind of mime types, which can be changed.. but in organizations network to change that is insane.
Better solution is dynamically change the acceptedFileTypes() method
You can change the file mime type easy enough. But you shouldn't change the acceptedFileTypes to accept an invalid file type...
Eric Buchanan
DeviceTests
How To Change MIME Type for a File | DeviceTests
Discover the steps to change a file's MIME type effortlessly. Enhance your website's compatibility and user experience with our expert guide.
No so easy.
The importer doesn't accept even the file witch it provide download as sample.
On my Linux it's works, but on Windows no.
On windows csv file created with notepad, also uploads as application/vnd.ms-excel.
I think, its in windows registry needs to be changed..