Has anybody been able to implement this functionality?
http://php.net/manual/en/session.upload-progress.php
The tl;dr is that when POSTing a form containing a file, if you include an input with the "name" attribute set to the value of session.upload_progress.name in php.ini, then PHP will populate $_SESSION with data about the status of the upload.
Form:
<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
(not important but obviously this is where you would normally give the file its actual name and move the uploaded file from the temp to a real directory)
<?php
print_r($_FILES);
?>
session.php:
Run this separate PHP file during the file upload to check for progress
<?php
$key = ini_get("session.upload_progress.prefix") . $_POST[ini_get("session.upload_progress.name")];
var_dump($_SESSION[$key]);
?>
I have tried every fathomable variation in these scripts and in php.ini settings and no matter what the $_SESSION array is never populated with any upload data. Session_start() is called by default. I tried in both v. 5.4 and 5.6. I have tried everything suggested in the comments in the PHP documentation including running with and without FastCGI. I have in general tried everything.
This is important because I am working on a desktop application that uses POST requests to communicate with .php scripts on a web server, I am not using the browser so JS/HTML5 solutions are not part of the picture. It is also impossible to write your own progress measuring functionality in PHP because the script which handles a file upload (upload.php) doesn't actually run until the upload (to the temp directory with a random name) is complete. There is no way to find out what actual file a temp is associated with until the upload is finished and the upload script runs, allowing access to $_FILES. Please help, I have tried every fathomable possibility. Thanks.