Import file with long name (or arabic name)
Package
filament/filament
Package Version
v3.2.124
Laravel Version
v11.x
Livewire Version
v3.x
PHP Version
8.3.x
Problem description
getting an error when importing large file names or Arabic file name ex:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'file_path' at row 1 (Connection: mysql, SQL: insert into `imports` (`user_id`, `file_name`, `file_path`, `importer`, `total_rows`, `updated_at`, `created_at`) values (209, عملاء شهر يناير 2024 البدر للمبيعات اون لاين واوف لاين .csv, /code/storage/app/livewire-tmp/97dKPqjXMEhVTL3x1swh3I6hfqyYKK-meta2LnZhdmE2KfYoSDYtNmH2LEg2YrZhtin2YrYsSAyMDI0INin2YTYqNiv2LEg2YTZhNmF2KjZiti52KfYqiDYp9mI2YYg2YTYp9mK2YYg2YjYp9mI2YEg2YTYp9mK2YYgLmNzdg==-.csv, App\Filament\Imports\ContactImporter, 53, 2024-11-17 08:09:15, 2024-11-17 08:09:15))
Expected behavior
imported succssfully.
Steps to reproduce
just import file named عملاء شهر يناير 2024 البدر للمبيعات اون لاين واوف لاين .csv
Reproduction repository (issue will be closed if this is not valid)
https://github.com/AQuadic/NO-REPO-NEEDED
Relevant log output
Sorry for not including repo, but it can be reproduced on any repo and on demo. just file name like I said.
@Saifallak
1406 Data too long for column 'file_path'
Looks like your file_path column is too small, probably varchar(255). You can try it with text type
@Saifallak 1406 Data too long for column
'file_path'Looks like your
file_pathcolumn is too small, probablyvarchar(255). You can try it withtexttype
Yes you're right, but this is the migration created by filament, that's why i opemed issue to be changed in the library itself
Hello, can not reproduse the bug.
https://github.com/user-attachments/assets/8aaf9443-101f-48b3-bbcd-3d035039437a
@Saifallak Hi! Any updates?
@Saifallak will you please include a reproduction repo to help reproduce this? For all we know it is fixed.
@Saifallak will you please include a reproduction repo to help reproduce this? For all we know it is fixed.
I just changed the column in db directly to text instead of string. and it got fixed.
This looks resolved now. Can this issue be closed?
Thanks!