PHP Uploadprogress extension function always returning null, with no upload data.

Posted by abhinavlal on Stack Overflow See other posts from Stack Overflow or by abhinavlal
Published on 2010-05-15T06:43:55Z Indexed on 2010/05/15 6:54 UTC
Read the original article Hit count: 325

Filed under:
|
|

I am using php 5.3.2 with uploadprogress extension to get a progressbar during upload using zend framework. Even the demo provided with zend is not working. code in zend example -

if (isset($_GET['uploadId'])) {
set_include_path(realpath(dirname(__FILE__) . '/../../../library')
                 . PATH_SEPARATOR . get_include_path());

require_once 'Zend/ProgressBar.php';
require_once 'Zend/ProgressBar/Adapter/JsPull.php';
require_once 'Zend/Session/Namespace.php';

$data          = uploadprogress_get_info($_GET['uploadId']);
$bytesTotal    = ($data === null ? 0 : $data['bytes_total']);
$bytesUploaded = ($data === null ? 0 : $data['bytes_uploaded']);

$adapter     = new Zend_ProgressBar_Adapter_JsPull();
$progressBar = new Zend_ProgressBar($adapter, 0, $bytesTotal, 'uploadProgress');

if ($bytesTotal === $bytesUploaded) {
    $progressBar->finish();
} else {
    $progressBar->update($bytesUploaded);
}

}

uploadprogress_get_info always returns null. I thought something is wrong with my code so i downloaded the working sample available at http://labs.liip.ch/uploadprogresssimple/index.php but even in that case in uploadprogress_get_info always return null.

My uploadprogress config values

uploadprogress support enabled

Version 1.0.1

uploadprogress.file.contents_template /tmp/upload_contents_%s

uploadprogress.file.filename_template /tmp/upt_%s.txt

uploadprogress.get_contents 1

While googling around i found uploadprogress extension has some issue with Suhosin Patch < 0.9.26 but i am using Suhosin Patch 0.9.9.1

© Stack Overflow or respective owner

Related posts about php

Related posts about file-upload