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 help
8 Replies
Dennis Koch
Dennis Koch16mo ago
Not sure whether Laravel supports the wildcard for mime types. Can you try with separate values? Maybe this is only for Filepond though
TheAbhishekIN
TheAbhishekINOP16mo ago
but it works for images, images also have same validation rule ->acceptedFileTypes(['image/*'])
Dennis Koch
Dennis Koch16mo ago
Hm weird. What file formats are you trying to upload?
TheAbhishekIN
TheAbhishekINOP16mo ago
mp4
TheAbhishekIN
TheAbhishekINOP16mo ago
awcodes
awcodes16mo ago
Can you verify the actual mime type of the video. Sometimes they can be application/mp4 depending on how they were encoded.
TheAbhishekIN
TheAbhishekINOP16mo ago
its, video/mp4 also added this application/mp4 in acceptedFileType() but still same issue
awcodes
awcodes16mo ago
Hmm. 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.
Want results from more Discord servers?
Add your server