0

Whats the maximum file size for an image when building a gallery form, i just tried uploading 3 images of about 6mb each, and the application completely blanked out.

when i try to read the $_Files array of the $_POST data the out put is i.e

dd(Input::file('files'));

and my output is

array( length=0; )

when i tried uploading files of lesser size, it worked perfectly, so i'm asking whats the best and preferred size to limit your images to when working with image uploads in laravel, i know i could adjust the max_file_size setting in the .ini file, but i like working with the defaults.

just incase of next time. thanks. and i would like to know why most importantly. if i am going to be adopting a pattern in my forms for handling images, then i want to keep in mind why i'm doing that.. thanks in anticipation.

Ande Caleb
  • 1,163
  • 1
  • 14
  • 35

3 Answers3

0

It has nothing to do with Laravel. As you mentioned yourself, some settings should be changed: post_max_size & upload_max_filesize

Stefan
  • 832
  • 8
  • 10
  • interesting. thanks for that response.. i just needed clarity. should work with that. – Ande Caleb Jun 04 '16 at 22:08
  • Just in case anyone else encounters issues with uploading to images to laravel, as mentioned above the upload_max_filesize and post_max_size need to be changed. I also had to change the memory_limit and max_execution_time. My internet is slow, so it needs more time to upload. Got to keep that in mind for your users. So essentially even though I only want 8Mb max upload. I set it to like 64Mb and it works fine now. – Dlaugh14 Dec 27 '16 at 03:01
0

Just be sure to set post_max_size value slightly bigger than upload size in php.ini file. Dont forget to restart the web service (apache/nginx) after that so the changes will take effect!

Bogdan Stoica
  • 4,349
  • 2
  • 23
  • 38
0

Probably you set the wrong php.ini file do this on laravel dd(phpinfo())and look the right php.ini use by laravel in the value : loaded configuration file