0

I am trying to upload my video on my website but I keep getting an error in laravel Illuminate \ Http \ Exceptions \ PostTooLargeException No message no matter how much I change everything I keep getting the same thing. Here is how I set my php ini

memory_limit = 3000M
post_max_size = 2000M
upload_max_filesize = 1000M


form 

    {!!Form::open(array('route'=>'profile.store','class'=>'formform','files'=>'true')) !!}


{{Form::file('video',array('id'=>'file','class'=>'thefile'))}}



                    {!!Form::close() !!}


  the controller 

    $this->validate($request,array(

     'video' => 'required|mimes:mp4,flv,wmv,avi,mov,qt',


    ));






    $pro=new Profile;

    $vid = $request->file('video');
      $filename = uniqid().$vid->getClientOriginalName();
      $path = $vid->storeAs(
'introvideo',
$filename);
      $location = public_path('/vids',$filename);
      $vid->move($location);
      $pro->profile = $filename;







    $pro->save();

           return redirect('dashboard')->with('success','Your business is now listed!');



}

3 Answers3

0

You need to stream the data rather than sending it all in one big chunk. Look up the javascript data api.

Darth Egregious
  • 18,184
  • 3
  • 32
  • 54
0

How do you run lavarel, as an Apache module, Fast CGI, developement server ?

Did you check the lavarel validator limits ?

Peter Húbek
  • 646
  • 6
  • 10
  • I just want to be able upload my videos with no limits. I am just here setting numbers and I don't even know. You tube has lots of videos and it uploads with no problem that's what I am trying to do here. – Stephany. S123 Mar 27 '18 at 17:51
0

try to change the value of upload_max_filesize and post_max_size in your php.ini

upload_max_filesize = 1000M

post_max_size = 1000M

dont forget to restart your local server

Just L
  • 80
  • 1
  • 2
  • 15
  • ok I will. One question is it bad if I put the memory_limit to -1? – Stephany. S123 Mar 28 '18 at 02:04
  • what do you want from put memory limit to -1 ? – Just L Mar 28 '18 at 02:15
  • I don’t want any limits so I heard you could add -1 but someone told me something about it’s dangerous is that true? Or can I do it – Stephany. S123 Mar 28 '18 at 02:17
  • i think change the memory limit its not to dangerous, but what ? - 1 ? can it ? from i know, memory limit is for handling apache service from server which affect to loading speed a website. its not limit the storage of file, but the system. its just like RAM, more greater capacity , more faster. so i suggest dont change it – Just L Mar 28 '18 at 02:28
  • Ok I won’t. So what should I do. If my website allows people to upload videos how do I go about that. I want to allow users to upload their video with no problem. Honestly I really thought this had to do with php ini what do I have to do? – Stephany. S123 Mar 28 '18 at 02:32
  • read this [https://stackoverflow.com/questions/2184513/change-the-maximum-upload-file-size](https://stackoverflow.com/questions/2184513/change-the-maximum-upload-file-size)) . one question, you already using web hosting ? or its still in your local server ? if u r already using web hosting, then you must call the administrator for it or try read the manual find the information, if you using local server like xampp or wampp, go to php.ini and change it. – Just L Mar 28 '18 at 02:41
  • if u r using laravel, try [https://stackoverflow.com/questions/46067336/laravel-max-upload-size-limitations](https://stackoverflow.com/questions/46067336/laravel-max-upload-size-limitations) – Just L Mar 28 '18 at 02:44
  • Right now I’m using xammp when everything is done I’m going to use bluehost for web hosting. I changed it so many times but I’m going to click the link you gave me. Thanks a lot for being patient and helpful it really means a lot – Stephany. S123 Mar 28 '18 at 02:46
  • hope it will help you :) – Just L Mar 28 '18 at 02:47
  • I wanted to make sure something. The memory limit has nothing to do with the uploading file but with Apache? – Stephany. S123 Mar 28 '18 at 12:41
  • yeah, thats my opinion – Just L Mar 29 '18 at 01:57