Edit report at https://bugs.php.net/bug.php?id=60196&edit=1
ID: 60196 User updated by: martin at psinas dot com Reported by: martin at psinas dot com Summary: Session Upload Progress - doesn't work -Status: Open +Status: Closed Type: Bug Package: Session related Operating System: Ubuntu 10.04 / Apache2 PHP Version: 5.4.0beta2 Block user comment: N Private report: N New Comment: I believe my installation was not configured correctly. I re-installed 5.4 following the instructions of a friend and everything worked. Previous Comments: ------------------------------------------------------------------------ [2011-12-17 19:06:35] crmalibu at gmail dot com This seems like expected behavior if session.upload_progress.cleanup = On, which is default. By the time his var_dump() script executes(even with a huge file), the upload is finished, and cleanup has already occurred. Even though the setting is documented here http://www.php.net/manual/en/session.configuration.php#ini.session.upload-progress.cleanup I feel strongly it needs to be mentioned here too, or you will get swarmed with bogus bug reports soon when this feature goes live. http://www.php.net/manual/en/session.upload-progress.php ------------------------------------------------------------------------ [2011-11-02 08:51:08] martin at psinas dot com How do you define "huge"? I've modified the form to contain 8 fields instead of 2, and in each field I'm uploading the php-5.4.0beta2.tar.gz (13.6 MB * 8). The form hangs for a few seconds while loading, then I get the empty array. ------------------------------------------------------------------------ [2011-11-02 03:18:05] larue...@php.net plz use a huge size file to test. ------------------------------------------------------------------------ [2011-11-01 23:34:07] martin at psinas dot com Description: ------------ Trying to test this new feature documented here: http://php.net/manual/en/session.upload-progress.php Can't seem to get it working. Test script: --------------- // form.php <?php session_start(); ?> <form action="upload.php" method="POST" enctype="multipart/form-data"> <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123" /> <input type="file" name="file1" /> <input type="file" name="file2" /> <input type="submit" /> </form> // upload.php <?php session_start(); var_dump($_SESSION); ?> Expected result: ---------------- I expect the following session values to be populated: <?php $_SESSION["upload_progress_123"] = array( "start_time" => 1234567890, // The request time "content_length" => 57343257, // POST content length "bytes_processed" => 453489, // Amount of bytes received and processed "done" => false, // true when the POST handler has finished, successfully or not "files" => array( 0 => array( "field_name" => "file1", // Name of the <input/> field // The following 3 elements equals those in $_FILES "name" => "foo.avi", "tmp_name" => "/tmp/phpxxxxxx", "error" => 0, "done" => true, // True when the POST handler has finished handling this file "start_time" => 1234567890, // When this file has started to be processed "bytes_processed" => 57343250, // Amount of bytes received and processed for this file ), // An other file, not finished uploading, in the same request 1 => array( "field_name" => "file2", "name" => "bar.avi", "tmp_name" => NULL, "error" => 0, "done" => false, "start_time" => 1234567899, "bytes_processed" => 54554, ), ) ); ?> Actual result: -------------- I get this: array(0) {} ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60196&edit=1