问题
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