TYPO3上传进度

时间:2017-06-29 06:07:42

标签: php typo3

我有TYPO3版本7.6.18

    public function uploadProgressAction(){
        session_start();
        echo $_SESSION['progval'];
        return false;
    }

    /**
     * action create
     *
     * @param \Istar\Fefiles\Domain\Model\Video $newVideo
     */
    public function createAction(\Istar\Fefiles\Domain\Model\Video $newVideo)
    {
        session_start();
        $progress_percents = 0;
        while(1 ==1){
            $progress_percents = $progress_percents + 1;
            $_SESSION['progval'] = $progress_percents;
            session_write_close();
            sleep(0.5);
        }
        die();
}

这是我的代码。我向uploadProgressAction发送ajax请求,我总是收到1.我似乎只设置了一次会话。请帮帮我)哪里有问题?

1 个答案:

答案 0 :(得分:0)

致电session_write_close()后,您的会话已关闭,您无法再写信了。