I'm trying to create a file upload progress bar using PHP and the APC_FETCH function.
I've had APC enabled on the server and set to On. I've downloaded a sample script, which works perfectly, however, while building my own, APC_FETCH() isn't returning a status for the file.
I am generating a unique ID, which is being set as the progress_key in the form. I'm then having an iframe populated with the content on a progress page with the progress_key also being passed to the progress page so it can get it's status. But there are no results.
Does anyone have any idea where I'm going wrong, as other scripts work perfectly, just not my own.
/* THE FORM */
<?php $upid = uniqid(); ?>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="">
<input type="file" name="fileField" id="fileField" />
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo $upid; ?>"/>
<input type="submit" name="button" id="button" value="Submit" onclick="startUpload();" />
/* THE STATUS PAGE */
echo "<br>upid = ".$_GET['upid'];
$status = apc_fetch('upload_'.$_GET['upid']);