|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-16 09:09 UTC] 175384354 at qq dot com
[2012-08-16 10:27 UTC] laruence@php.net
-Status: Open
+Status: Feedback
[2012-08-16 10:27 UTC] laruence@php.net
[2012-08-17 08:05 UTC] 175384354 at qq dot com
-Status: Feedback
+Status: Open
[2012-08-17 08:05 UTC] 175384354 at qq dot com
[2013-06-20 09:52 UTC] ab@php.net
-Status: Open
+Status: Feedback
[2013-06-20 09:52 UTC] ab@php.net
[2013-06-26 06:38 UTC] ab@php.net
-Status: Feedback
+Status: No Feedback
[2013-06-26 06:38 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 22:00:01 2025 UTC |
Description: ------------ php post Test script: --------------- <?php setcookie("myup","tgy_cookie_up",time()+3600); ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value=""> <input type="file" name="pic" /><br> <input type="file" name="text" /><br> <input type="file" name="doc" /><br> <input type="file" name="pdf" /><br> <input type="submit" value="开始上传"/> </form> <? $up_info=$_FILES; $upload_dir="upload/"; $typelist=array("image/gif","image/jpeg","image/pjpeg","image/png"); if (!is_dir( $upload_dir)) { if (!mkdir($upload_dir)) die ("upload_files directory doesn't exist and creation failed"); if (!chmod($upload_dir,0755)) die ("change permission to 755 failed."); } $handle=opendir($upload_dir); $filelist = ""; foreach($up_info as $k_name=>$value){ //用foreach循环 处理多个文件的上传 //2.判断文件是否上传错误 if($up_info[$k_name]['error']>0){ switch($up_info['error'][$i]){ case 1: $err_info="上传的文件超过了 php.ini 中 upload_max_filesize 选项限制的值"; break; case 2: $err_info="上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值"; break; case 3: $err_info="文件只有部分被上传"; break; case 4: $err_info="没有文件被上传"; break; case 6: $err_info="找不到临时文件夹"; break; case 7: $err_info="文件写入失败"; break; default: $err_info="未知的上传错误"; break; } continue($err_info); } $exten_name=pathinfo($up_info[$k_name]['name'],PATHINFO_EXTENSION); do{ $main_name=date('YmHis'.'--'.rand(100,999)); $new_name=$main_name.'.'.$exten_name; }while(file_exists($to_path.'/'.$new_name)); //6.判断是否是上传的文件,并执行上传 if(is_uploaded_file($up_info[$k_name]['tmp_name'])){ if(move_uploaded_file($up_info[$k_name]['tmp_name'],$upload_dir.'/'.$new_name)){ echo '上传成功!<br>'; }else{ echo '上传文件移动失败!'; } }else{ echo '文件不是上传的文件'; } } //for循环的括号 while ($file = readdir($handle)) { if(!is_dir($file) && !is_link($file)) { $filelist .= "<a href='$upload_dir$file'>".$file."</a>"; if ($DELETABLE) $filelist .= " <a href='?del=$upload_dir$file' title='delete'>x</a>"; $filelist .= "<sub><small><small><font color=grey> ".date("d-m H:i", filemtime($upload_dir.$file))."</font></small></small></sub>"; $filelist .="<br>"; } } echo "COOKIE:".$HTTP_COOKIE_VARS['myup']."<br>"; echo $filelist; ?> Expected result: ---------------- PHP从PHP5.2.17到5.3.15 都存在一个问题,会导致WEB服务器程序崩溃。 BUG描述: 服务器操作系统:windows server 2003 浏览器:MS IE 7.0 PHP使用方式:isapi 打开一个POST上传文件的PHP页面并上传一个文件,如果让这个上传页面闲置十几分钟以上,再次提交上传,会导致WEB服务器崩溃,而且没有任何提示。