Most of the advice I see says to use the following configuration value for session.upload_progress data
session.upload_progress.cleanup=on
From what I can see the result of this approach is that $_SESSION["upload progress key"]
is erased immediately on completion of the upload, effectively wiping out all the data related to the completed file upload.
As one is running a separate XHR process to poll this data and display a progress bar, if the file being uploaded is very small, it is conceivable that the separate XHR thread only polls after the file upload has completed and the data has been removed.
I have 2 questions for proponents of the instantaneous deletion of data on completion of upload approach:
- If no data is found on the first XHR poll, is there a way one can reliably identify whether the file has finished uploading successfully, or whether something has gone wrong and the upload has not in fact started.
- Even if 1 or more polls has run during the upload successfully, on the final poll, where the upload data has been erased, given that the file error status is contained within the erased data, is there a way that one can reliably identify that the file upload was successful?
Alternatively, is there no reliable way to achieve either/both of the above and would a better approach be to use
session.upload_progress.cleanup=off
and interrogate the upload data on completion, then manually manage cleanup of session data?