drq61040 2013-01-16 15:36
浏览 46
已采纳

PHP Session Upload使用自定义会话处理程序的进度

PHP5.4 provides Session Upload Progress indication. I have noticed that it works, but only if session.save_handler is set to files, and session.name is not modified. As soon as I modify these values, the superglobal $_SESSION['upload_progress_<key>'] is empty / not set.

Is it possible to provide session upload progress indication, but with custom session handling? Even save handler memcache does not work...

  • 写回答

2条回答 默认 最新

  • dsvjmc0907 2013-01-16 16:52
    关注

    As @Marc points out: Session Upload Progress indication is running while the upload is ongoing, and before control is handed over to a user's PHP code. As a result, the php upload handler uses configuration data set in the .ini files, and can only use modules that are available at that time.

    It is possible to use the memcache save-handler, or specify a different session name, as long as everything is configured in an .ini file:

    session.save_handler = memcache
    session.save_path = "tcp://198.51.100.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://198.51.100.2:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
    session.name = "myUploadProgressSession"
    

    It's not possible to specify these settings via ini_set("session.save_handler", "memcache") in code, since this is executed too late.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试