File upload validation error
this is my file upload with validation for video:
Forms\Components\FileUpload::make('product_video')
->acceptedFileTypes(['video/*'])
->directory('product-media')
->storeFileNamesIn('original_file_name')
but getting this validation error: The product video field must be a file of type: video/*.
please help8 Replies
Not sure whether Laravel supports the wildcard for mime types. Can you try with separate values?
Maybe this is only for Filepond though
but it works for images, images also have same validation rule
->acceptedFileTypes(['image/*'])
Hm weird. What file formats are you trying to upload?
mp4
Can you verify the actual mime type of the video. Sometimes they can be application/mp4 depending on how they were encoded.
its, video/mp4
also added this
application/mp4
in acceptedFileType()
but still same issueHmm. Yea. Must be a FileUpload thing then. Wildcard minetypes are not generally accepted as valid by the community. So when they do work they are usually a custom implementation.