Fail, Upload zip file

Forms\Components\FileUpload::make('file')->acceptedFileTypes(['application/zip'])
15 Replies
Dennis Koch
Dennis Koch2y ago
Check the mime type of the file
zainalab
zainalabOP2y ago
I've used a lot of random zip files and the result is always the same.
Dennis Koch
Dennis Koch2y ago
And what’s the mime type?
zainalab
zainalabOP2y ago
i have checked using mime_content_type the result is application/zip
zainalab
zainalabOP2y ago
the result is still like this
zainalab
zainalabOP2y ago
without using ->acceptedFileTypes(['application/zip'])
wyChoong
wyChoong2y ago
https://codepen.io/rikschennink/pen/NzRvbj what is the result if you try to use this code snippet to upload
zainalab
zainalabOP2y ago
I use filament form builder Forms\Components\FileUpload::make('file')->acceptedFileTypes(['application/zip']) https://filamentphp.com/docs/2.x/forms/fields#file-upload
wyChoong
wyChoong2y ago
let me rephrase go to the codepen, upload a file, and what is the mime type it returns also, check your livewire.config https://laravel-livewire.com/docs/2.x/file-uploads#global-validation
zainalab
zainalabOP2y ago
work broo.. 👍 mime type returned application/x-zip-compressed and i have used acceptedFileTypes(['application/x-zip-compressed']) thanks bro 👍
wyChoong
wyChoong2y ago
just curios what browser you using, also you on Windows?
zainalab
zainalabOP2y ago
I use windows, chrome and app laragon
zainalab
zainalabOP2y ago
for best practice should use all of these application/zip, application/octet-stream, multipart/x-zip, application/zip-compressed, application/x-zip-compressed, application/x-zip ?
wyChoong
wyChoong2y ago
Maybe not multipart and octet-stream
Want results from more Discord servers?
Add your server