Storing PHP session.upload_progress data in the database

隐身守侯 提交于 2020-01-06 14:06:17

问题


Using session_set_save_handler in PHP 5.4.40, I have created a session handler that works well ...except for session.upload_progress data when uploading a file.

My session handler completely ignores upload progress data, and I can only seem to get the progress data to save at all when:

  • session.save_handler=files; and
  • the session file is saved in the same path as session.save_path

Is it possible to save session.upload_progress data in the database?

Update: as at PHP 7 this still appears to be an issue. I have therefore opened PHP 7 Bug #74131


回答1:


The php documentation says this here:

Warning: The web server's request buffering has to be disabled for this to work properly, else PHP may see the file upload only once fully uploaded. Servers such as Nginx are known to buffer larger requests.

So what you want to do may be impossible...




回答2:


@Pancho I switched to use PECL uploadprogress. Works fine. Have to use mod_php and not fastcgi/fpm. User sessions are all in the db.



来源:https://stackoverflow.com/questions/29867392/storing-php-session-upload-progress-data-in-the-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!