F
Filament3mo ago
ericmp

File upload component not validating correctly

In the file upload it says 85KB But the validation error says cannot be greater than 100KB What is happening?
No description
8 Replies
awcodes
awcodes3mo ago
Can you share the code for your FileUpload field. This just doesn’t make any sense.
ericmp
ericmpOP3mo ago
Forms\Components\SpatieMediaLibraryFileUpload::make('cover')
->disk('s3')
->collection('cover')
->maxSize(100) // 100KB
->openable()
->downloadable()
->previewable()
->imageEditor()
->image()
->rules([
\Illuminate\Validation\Rule::dimensions()
->maxWidth(500)
->maxHeight(500)
,
])
->imageResizeTargetHeight(500)
->imageResizeTargetWidth(500)
,
Forms\Components\SpatieMediaLibraryFileUpload::make('cover')
->disk('s3')
->collection('cover')
->maxSize(100) // 100KB
->openable()
->downloadable()
->previewable()
->imageEditor()
->image()
->rules([
\Illuminate\Validation\Rule::dimensions()
->maxWidth(500)
->maxHeight(500)
,
])
->imageResizeTargetHeight(500)
->imageResizeTargetWidth(500)
,
filament version (composer.json):
"require": {
"php": "^8.1",
"filament/filament": "^3.2",
"filament/forms": "^3.0-stable",
"filament/notifications": "^3.0-stable",
"filament/spatie-laravel-media-library-plugin": "^3.0-stable",
"filament/tables": "^3.0-stable",
"require": {
"php": "^8.1",
"filament/filament": "^3.2",
"filament/forms": "^3.0-stable",
"filament/notifications": "^3.0-stable",
"filament/spatie-laravel-media-library-plugin": "^3.0-stable",
"filament/tables": "^3.0-stable",
awcodes
awcodes3mo ago
I wonder if there's some conflict with including the individual packages with filament\filament. You don't need to require the individual packages if you are using filament\filament as it will handle the requirements by itself. could be something in the filepond too mis-reading the filesize, but it doesn't make sense.
ericmp
ericmpOP3mo ago
i can share u the image too, maybe is the image or something else, is really weird well, ill try to remove the individual packages, update filament and try it again
awcodes
awcodes3mo ago
does it happen for all images, or just that one?
ericmp
ericmpOP3mo ago
afaik just that one
awcodes
awcodes3mo ago
So, wouldn’t that lend to a corruption in the file itself and not the code?
ericmp
ericmpOP2mo ago
unsure bout that
Want results from more Discord servers?
Add your server