filament icon indicating copy to clipboard operation
filament copied to clipboard

Import file with long name (or arabic name)

Open Saifallak opened this issue 1 year ago • 7 comments

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 avatar Nov 17 '24 12:11 Saifallak

@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

jonaaix avatar Nov 23 '24 15:11 jonaaix

@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

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

image

Saifallak avatar Nov 23 '24 16:11 Saifallak

Hello, can not reproduse the bug.

https://github.com/user-attachments/assets/8aaf9443-101f-48b3-bbcd-3d035039437a

dmitry-udod avatar Nov 28 '24 14:11 dmitry-udod

@Saifallak Hi! Any updates?

dmitry-udod avatar Dec 25 '24 09:12 dmitry-udod

@Saifallak will you please include a reproduction repo to help reproduce this? For all we know it is fixed.

alex-elivate avatar May 11 '25 14:05 alex-elivate

@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.

Saifallak avatar May 18 '25 13:05 Saifallak

This looks resolved now. Can this issue be closed?

alex-elivate avatar May 22 '25 16:05 alex-elivate

Thanks!

danharrin avatar Jun 21 '25 15:06 danharrin