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条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改