为什么我的会话upload_progress总是返回null?

时间:2012-09-26 21:00:16

标签: php session upload progress-bar

我已经在php.ini中安装了所有扩展,我用php 5.4运行apache

的index.php

enter code here
<?php

 session_start();

 ?>

 <html>


<body>



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


</body>

</html>

upload.php的

enter code here

<?php

session_start();




  $key1 = ini_get("session.upload_progress.prefix") ."123";

 echo $key1;

  echo $_SESSION[$key1][1];


  $target_path = "up/" . basename($_FILES['file']['name']);
  move_uploaded_file($_FILES['file']['tmp_name'], $target_path );
  chmod($target_path , 0777);


  echo "<br/><br/><br/>";


  //$key = ini_get("session.upload_progress.prefix") . "123";
  var_dump($_SESSION[$key1]);


  echo "<br/>";
  echo "Session: ". var_dump($_SESSION);


  echo "<br/>";
  echo "Files: ". var_dump($_FILES);

&GT;

我在php.ini中安装了所有会话和uploadprogress扩展,我在Linux环境下使用php 5.4运行apache(Ubuntu)

0 个答案:

没有答案