Example #1
0
 public function uploadAction()
 {
     header("Content-Type: application/json");
     if (!is_null(filter_input(INPUT_GET, "push", FILTER_UNSAFE_RAW))) {
         $adapter = new Zend_ProgressBar_Adapter_JsPush(array('updateMethodName' => 'Zend_ProgressBar_Update', 'finishMethodName' => 'Zend_ProgressBar_Finish'));
         do {
             $progress = Zend_File_Transfer_Adapter_Http::getProgress(array('progress' => $adapter));
         } while (!$progress['done']);
     } else {
         $adapter = new Zend_ProgressBar_Adapter_JsPull();
         Zend_File_Transfer_Adapter_Http::getProgress(array('progress' => $adapter));
     }
     exit;
 }
Example #2
0
 * @package    Zend_ProgressBar
 * @subpackage Demos
 * @copyright  Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
/**
 * This sample file demonstrates an advanced use case of Zend_ProgressBar with
 * Zend_Form and Zend_File_Transfer.
 */
set_include_path(realpath(dirname(__FILE__) . '/../../../library') . PATH_SEPARATOR . get_include_path());
if (isset($_GET['progress_key'])) {
    require_once 'Zend/File/Transfer/Adapter/Http.php';
    require_once 'Zend/ProgressBar.php';
    require_once 'Zend/ProgressBar/Adapter/JsPull.php';
    $adapter = new Zend_ProgressBar_Adapter_JsPull();
    Zend_File_Transfer_Adapter_Http::getProgress(array('progress' => $adapter));
    die;
}
?>
<html>
<head>
    <title>Zend_ProgressBar Upload Demo</title>
    <style type="text/css">
        iframe {
            position: absolute;
            left: -100px;
            top: -100px;

            width: 10px;
            height: 10px;
            overflow: hidden;