title: Zend_Progressbar + JQuery + uploading a video
body: <p>I would like to show a dynamic progressbar in my applciation while uploading a video (*.flv format). I searched on the Web for more than 2 hours but I can't find any tutorial to guide me through this process.</p>
  
  <p>What I have so far:</p>
  
  <ul>
  <li>script that uploads a video</li>
  <li>jQuery library included in the  section</li>
  </ul>
  
  <p>But what to do next? Here is the controller action for uploading a video I use:</p>
  
  <pre><code>public function uploadPublicVideoAction()
  {
      $request = $this-&gt;getRequest();
      $media = $this-&gt;_getTable('Media');
  
      $form = $this-&gt;_getForm('UploadPublicVideo',
                              $this-&gt;_helper-&gt;url('upload-public-video'));
      // if POST data has been submitted
      if ($request-&gt;isPost()) {
          // if the UploadPublicVideo form has been submitted and the submitted data is valid
          if (isset($_POST['upload_public_video']) &amp;&amp; $form-&gt;isValid($_POST)) {
  
              $data = $form-&gt;getValues();
              $data['user_id'] = $this-&gt;view-&gt;identity-&gt;id;
  
              $ext = end(explode('.', $form-&gt;video-&gt;getFileName()));
  
              $dbTrans = false;
  
              try {
  
                  $db = $this-&gt;_getDb();
                  $dbTrans = $db-&gt;beginTransaction();
  
                  $data['type'] = 'video';
                  $data['status'] = 'public';
                  $paths = $media-&gt;add($data, $ext);
  
                  if (file_exists($paths[0])) {
                     unlink($paths[0]);
                  }
                  if (file_exists($paths[1])) {
                     unlink($paths[1]);
                  }
  
                  // add filter for renaming the uploaded photo
                  $form-&gt;video-&gt;addFilter('Rename',
                                          array('target' =&gt; $paths[0],
                                                'overwrite' =&gt; true));
  
                  // upload the video
                  $form-&gt;video-&gt;receive();
  
                  // create a thumbnail
                  //$this-&gt;_helper-&gt;FlvThumbnail($path[0], $path[1]);
  
                  $db-&gt;commit();
  
                  $form-&gt;reset();
  
                  $this-&gt;view-&gt;success = 'Public video successfully uploaded';
  
              } catch (Exception $e) {
                  if (true === $dbTrans) {
                      $db-&gt;rollBack();
                  }
                  $this-&gt;view-&gt;error = $e-&gt;getMessage();
              }
  
          }
      }
  
      $this-&gt;view-&gt;headTitle('Upload Public Video');
      $this-&gt;view-&gt;form = $form;
  }
  </code></pre>
  
  <p>Can anyone show me a simple way to use Zend_Progressbar and jQuery together to achieve a dynamic upload progressbar?</p>