title: Laravel form - show file upload progress, then redirect to view when uploading finishes
body: <p>I have a laravel application which successfully uploads files. I need to show a progress bar when the files are uploading since users might upload videos and then redirect to a certain view when uploading finishes. 
  I have tried a few solutions which actually worked but not to my taste. For example, i tried DropZone but i only upload one file and i don't need the drag and drop feature. 
  The solution that worked and came close to what i wanted is using jquery.form plugin. But the problem with it was, i still want the form to submit and redirect to the next page when the file upload finishes. 
  Meaning, when uploading finishes, i still want the next line to be executed</p>
  
  <p>return redirect()->action('PostController@edit', $post->PostID);</p>
  
  <p>Here is my Controller (PostController)</p>
  
  <pre><code>public function attachstore(Request $request, $PostID)
  {
  
  $post = Post::findOrFail($PostID);
  
  if ($request-&gt;hasFile('TextFile')) {
      $TextName = "";
  
      $now = \DateTime::createFromFormat('U.u', microtime(true));
      $nowStr = $now-&gt;format("m-d-Y-H-i-s-u");
  
      $TextName =  $nowStr . '.' . $request-&gt;file('TextFile')-&gt;getClientOriginalExtension();
      $request-&gt;file('TextFile')-&gt;move(base_path() . '/public/textuploads/', $TextName);
      $post-&gt;PostText = $TextName;  
  }  
  
  
  if ($request-&gt;hasFile('VideoFile')) {
      $VideoName = "";
      $now = \DateTime::createFromFormat('U.u', microtime(true));
      $nowStr = $now-&gt;format("m-d-Y-H-i-s-u");
  
      $VideoName =  $nowStr . '.' . $request-&gt;file('VideoFile')-&gt;getClientOriginalExtension();
      $request-&gt;file('VideoFile')-&gt;move(base_path() . '/public/videouploads/', $VideoName);
      $post-&gt;PostVideo = $VideoName; 
  }  
  
  $post-&gt;Save();
  
  return redirect()-&gt;action('PostController@edit', $post-&gt;PostID);
  </code></pre>
  
  <p>}</p>
  
  <p>Here is my view (attach.blade.php)</p>
  
  <pre><code>   {!! Form::open(array('route' =&gt; array('posts.attachstore', $post-&gt;PostID), 'files' =&gt; true)) !!}
     &lt;div class="col-md-12"&gt;    
      &lt;div class="form-group"&gt;     
        {!! Form::file('TextFile', null, array('class'=&gt;'form-control')) !!}
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="col-md-12"&gt;    
      &lt;div class="form-group"&gt;     
        {!! Form::file('VideoFile', null, array('class'=&gt;'form-control')) !!}
      &lt;/div&gt;
    &lt;/div&gt;
  
    {!!Form::button('Next', array('type' =&gt; 'submit', 'class' =&gt; 'btn btn-primary finish col-md-4'))  !!}
    {!! Form::close() !!}
  </code></pre>
  
  <p>I don't know whether this could be done without using ajax, but i'd prefer a solution which uses ajax only to report how much file the server has received or the client has sent. I don't want to upload the files using ajax, only an estimate of the transferred file size.</p>