Thursday, March 9, 2017

Multiple file upload with different mimetype in laravel?

I have a problem regarding handling multiple file uploads with different mimetypes with Laravel. In my form I have:

  • file input for the cover image (accepts ONE image file)
  • file input for image gallery (accepts MULTIPLE image files)
  • file input for documents (accepts MULTIPLE documents files)

For the first two cases, I can handle them using a custom request class as mentionned here.

What should I do add to handle the documents upload? Should I process the field normally in the controller? Or should I add another method to the custom request class to handle it separately?



via Mohamed Gallah

Advertisement