扫码关注官方订阅号
https://www.pureweber.com/art...这是php5.4新增的一个功能 使用$_SESSION获取上传进度 但是我按介绍 获得的$_SESSION总为空 根本没有那个键 上传进度就直接100% 求解!
光阴似箭催人老,日月如移越少年。
实际上这个功能可能无法使用,因为文档中的注释有这么一段
Note, this feature doesn't work, when your webserver is runnig PHP via FastCGI. There will be no progress informations in the session array.
如果php是通过FastCGI模式运行的web服务器之后,这个特性无法使用。主要是因为在php获取到客户端的输入之前,上传文件已经在web服务器上完成了,因此总是100%。
可以考虑使用nginx的HttpUploadProgressModule模块。
参考:Does session upload progress work with nginx and php-fpm?
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
实际上这个功能可能无法使用,因为文档中的注释有这么一段
如果php是通过FastCGI模式运行的web服务器之后,这个特性无法使用。主要是因为在php获取到客户端的输入之前,上传文件已经在web服务器上完成了,因此总是100%。
可以考虑使用nginx的HttpUploadProgressModule模块。
参考:Does session upload progress work with nginx and php-fpm?