dongniaoli1822 2015-04-28 21:25
浏览 32

PHP 5.4 - 可靠地询问session.upload_progress信息

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大