I'm trying to make work an upload_progress session after a bunch of changes in php.ini like:
session.upload_progress.enabled = On
;session.upload_progress.cleanup = On
session.upload_progress.prefix = "upload_progress_"
session.upload_progress.name = "123"
session.upload_progress.freq = "1%"
session.upload_progress.min_freq = "1"
and created and html based page with form to submit files:
<form action="upload_progress.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>
and then the server side script which uploading files properly:
session_start();
move_uploaded_file($_FILES['file1']['tmp_name'], './uploads/'.$_FILES['file1']['name']);
move_uploaded_file($_FILES['file2']['tmp_name'], './uploads/'.$_FILES['file2']['name']);
print_r($_SESSION);
There is an empty array in the $_SESSION
globals, although files upload completed correctly. What is the problem with session settings?
I'm using PHP 5.4.5
Notice: Undefined index: upload_progress_123 in C:\apache\localhost\www\upload_progress.php on line 13