J
J
jazzus2019-03-14 11:52:36
Laravel
jazzus, 2019-03-14 11:52:36

How to upload docx in Laravel?

Validation rule in the request file

'document' => 'required|file|mimes:doc,pdf,docx|max:10024',

.docx file Fails
validation
Files with other mimes extensions pass. The network advises to put zip in the check, but I don’t need zip and it didn’t help.
I wanted to specify mimetypes but did not find docx here.
What should I do? Write your own rule, pull out the extension and check?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
backEndDeveloper, 2019-03-14
@backEndDeveloper

Try uploading a file and see how PHP sees the file using the mime_content_type function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question