You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi this happened to me as well, I have a different scenario and was able to find the culprit (but not a solution).
In my example I have an action opening a modal with the FileUpload in its form and the creation of one entities for each uploaded file (within the action itself).
The Resource, then, has a relationManager with the entities created in the above-mentioned action.
If in the relationManager we add a ->poll('5s') then the issue appears, if we don't it works flawlessly.
I've created a repo with the two versions of the Resources so you can try it out both the working and the non-working version.
Please find the repository at the following URL, I've added a little instruction in the README and it also is shipped with some test files to be uploaded, for your convenience.
Package
filament/filament
Package Version
3
Laravel Version
11
Livewire Version
V3
PHP Version
php 8
Problem description
When I upload multiple files, some of the files are missing.
Expected behavior
All the files should be present in the desired folder.
Steps to reproduce
Section::make('') ->relationship('result_files') ->schema([ FileUpload::make('attachments') ->columnSpan(12) ->multiple() ->maxSize(100000) ->disk('uploads') ->directory('result_files') ->acceptedFileTypes(["application/pdf"]) ->getUploadedFileNameForStorageUsing(function ($file): string { $fileName = str($file->getClientOriginalName()); $fileName_str = preg_replace('/[^a-zA-Z0-9.]/','',iconv('UTF-8', 'ASCII//TRANSLIT', $fileName)); return (string) str($fileName_str)->prepend(now() . '-'); }) ->downloadable() ->rules([ new MalwareFile] ) ->label(__('application.resource.result_documents')) ]),
FileUpload::make('attachments') ->columnSpan(12) ->multiple() ->maxSize(100000) ->disk('uploads') ->visibility('private') ->directory('application_files') ->getUploadedFileNameForStorageUsing(function ($file): string { $fileName = str($file->getClientOriginalName()); $fileName_str = preg_replace('/[^a-zA-Z0-9.]/','',iconv('UTF-8', 'ASCII//TRANSLIT', $fileName)); return (string) str($fileName_str)->prepend(now() . '-'); }) ->downloadable() ->rules([ new MalwareFile] ) ->label(__('application.resource.application_documents')),
livewire.php
'temporary_file_upload' => [ 'disk' => 'tmp', // Example: 'local', 's3' | Default: 'default' "rules" => "file|mimes:pdf,jpg,jpeg,png,doc,docx,svg,mp4,mp3 | max:100000", // 'rules' => 'max:100000', // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', 'mov', 'avi', 'wmv', 'mp3', 'm4a', 'jpg', 'jpeg', 'mpga', 'webp', 'wma', 'pdf' ], 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... ],
Reproduction repository (issue will be closed if this is not valid)
https://github.com/guma-005/Filament-issue.git
Relevant log output
No response
Donate 💰 to fund this issue
The text was updated successfully, but these errors were encountered: