hasanhatem's avatar

how to allow laravel upload XBM and WBMP files?

hello

i wanna allow user to upload xbm and wbmp files with other extensions, so this is my validate

$validate = Validator::make($request->all(), [
      'file' => ['file', 'required', 'mimes:jpeg,png,jpg,gif,webp,avif,bmp,xbm,wbmp', 'max:51200'],
]);

laravel don't allow this extension to upload. how can i make laravel accept this files extensions?

0 likes
15 replies
sr57's avatar

laravel don't allow this extension to upload

Where do your read this?

Whot's your form?

hasanhatem's avatar

@sr57 Its uploader i wanna this file to upload in my webiste. how can i make it ?

hasanhatem's avatar

@sr57 Bro !!!? just i make input file and i want to allow users upload this type of files. its not need to uploader and types. just tell me you know how?

hasanhatem's avatar

@sr57 really i didn't read that. I searched about this issue but i don't find any thing. so do you any method to allow my laravel upload the extensions? because there is a lot of websites allow to upload this type of extensions.

sr57's avatar

@hasanhatem

I known this, see my first answer

Without code, not sure you'll get to upload anything. Take an example from the web to upload an other image type and it should work from your types.

sr57's avatar

Hello @hasanhatem

Many people want to help here, and most of the questions get answers quickly.

Why didn't you answer my questions?

At least ask/reformulate if you don't understand.

hasanhatem's avatar
hasanhatem
OP
Best Answer
Level 5

@sr57 because you don't know what you talking i just asked a simple question and you made it complicated.

I just have input

<input type="file" name="uploader" id="uploader" data-uploader multiple>

I just want to validate the files to accept: XBM , WBMP.

$validate = Validator::make($request->all(), [
            'file' => ['file', 'required', 'mimes:jpeg,png,jpg,gif,webp,avif,xbm,wbmp', 'max:51200'],
        ]);

why you ask 10 questions>!?!!! you asked what uploader I used I just use simple form and simple validation. just tell me how to make that. after that i will call that help

sr57's avatar

why you ask 10 questions>!?!!!

Only 2, reread my first post

And 3 days later you answer ... partially

That's said, if you don't have other mistake in your form this should work :

    'uploader' => ['required', 'mimes:jpeg,png,jpg,gif,webp,avif,xbm,wbmp', 'max:51200'],

Next time don't imagine that we are able to read in your mind, you was the only one who knows that "uploader" was the name of your input and not, as I thought, a package you used.

hasanhatem's avatar

@sr57

 'uploader' => ['required', 'mimes:jpeg,png,jpg,gif,webp,avif,xbm,wbmp', 'max:51200'],

this not working

hasanhatem's avatar

@sr57 Hi bro, look this is the message when upload xbm file

The file must be a file of type: png, jpg, jpeg, gif, webp, ico, bmp, tif, tiff, jpe, xbm

and this is my validation

$validate = Validator::make($request->all(), [
            'file' => ['file', 'required', 'mimes:png,jpg,jpeg,gif,webp,ico,bmp,tif,tiff,jpe,xbm', 'max:51200'],
]);

Please or to participate in this conversation.