Fail, Upload zip file
Forms\Components\FileUpload::make('file')->acceptedFileTypes(['application/zip'])
15 Replies
Check the mime type of the file
I've used a lot of random zip files and the result is always the same.
And what’s the mime type?
i have checked using
mime_content_type
the result is application/zip
the result is still like this
without using
->acceptedFileTypes(['application/zip'])
https://codepen.io/rikschennink/pen/NzRvbj what is the result if you try to use this code snippet to upload
I use filament form builder
Forms\Components\FileUpload::make('file')->acceptedFileTypes(['application/zip'])
https://filamentphp.com/docs/2.x/forms/fields#file-uploadlet 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
work broo.. 👍
mime type returned
application/x-zip-compressed
and i have used acceptedFileTypes(['application/x-zip-compressed'])
thanks bro 👍just curios what browser you using, also you on Windows?
I use windows, chrome and app laragon
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
?Maybe not multipart and octet-stream