douhoushou8385 2014-04-11 11:59
浏览 103
已采纳

在php INI中找不到PHP Session upload_progress

PHP 5.4 introduce a new feature to track file upload. this feature is

$_SESSION upload_progress.

We have to enable it via php.ini.

Though I can't find any place in my php.ini to enable this option. What's the problem?

My php version is 5.4.

  • 写回答

1条回答 默认 最新

  • doutu1889 2014-04-11 12:18
    关注

    You need to add these params to your php.ini file.

    session.upload_progress.enabled = on
    session.upload_progress.prefix = "upload_progress_"
    session.upload_progress.name = "blabla"
    

    Check this <form>

    <form action="upload.php" method="POST" enctype="multipart/form-data">
     <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="blabla" />
     <input type="file" name="file1" />
     <input type="file" name="file2" />
     <input type="submit" />
    </form>
    

    and on your PHP..

    <?php
    $_SESSION["upload_progress_blabla"] = array(
     "start_time" => 1234567890,   // The request time
     "content_length" => 57343257, // POST content length
     "bytes_processed" => 453489,  // Amount of bytes received and processed
     "done" => false,              // true when the POST handler has finished, successfully or not
     "files" => array(
    

    This is a mixture of information and taken from PHP Manual as well. You need to check out that seriously.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料