dry0106 2010-11-15 04:18
浏览 64
已采纳

使用php文件上传上传图像的问题

hi guys i am uploading the images using the @PhP file upload Method @ If i upload 10 Images at a time (Each Images is 2000 /3000 dimension). then the on click save function is not working. if i upload 5 images or less than five images then its working fine wats wrong with my coding i just include my php code with this post <input value="Save" type="submit" name="SubSave" id="SubSave" onClick="return changes();">

 if($_POST['SubSave'] == "Save"){
    $aid = $_GET['rid'];
 $updcount = $_POST['theValue'];


if($_SESSION["almgtype"]==1 || (GetUserNoPhoto($_SESSION["almgid"]))>(GetTotalPhotoCount1($_SESSION["almgid"],$aid))) {


  $uid = $_SESSION["almgid"];

 for($k=1;$k<=$updcount;$k++) { 
        //echo $k;
   echo $_FILES["uploadfile"]["type"];

if($_FILES["uploadfile".$k]["name"]!="") {

if(($_FILES["uploadfile".$k]["type"] == "image/gif") || ($_FILES["uploadfile".$k]["type"] == "image/jpeg")|| ($_FILES["uploadfile".$k]["type"] == "image/pjpeg") || ($_FILES["uploadfile".$k]["type"] == "image/png")) {

 if ($_FILES["uploadfile".$k]["error"] > 0)
  {
  echo "Error: " . $_FILES["uploadfile".$k]["error"] . "<br />";
  }
else
  {  
       move_uploaded_file($_FILES["uploadfile".$k]["tmp_name"],
      "photoalbum/" . $_FILES["uploadfile".$k]["name"]);
      $uploadfile =  "photoalbum/" . $_FILES["uploadfile".$k]["name"];
  } 
  $path  = $uploadfile;
  $checklist = "select * from amt_photos1 where aid = '".trim($aid)."' and uid = '".trim($uid)."' and path = '".trim($path)."'";
  $chkresult  = mysql_query($checklist);
  if(mysql_num_rows($chkresult) == 0) {
  $i = 0;
  $path =$uploadfile;
  $result = "insert into amt_photos1 set uid = '".trim($uid)."',
                                     aid = '".trim($aid)."',
                                     path = '".trim($path)."',
                                     status = '0',
                                     createdby = '".$_SESSION["almgid"]."',
                                     createddate = now()";

  $rowlist = mysql_query($result) or die("Error:(".mysql_error().")".mysql_error());


                } 
                /**********************  if file already exist means ******************************************/
                else {
                $err= "The Uploaded file name ".$path." Is already exisit in the Album. Rename It or try to add Any other Photos";

                    }
                /**********************  if file already exist means ******************************************/
                $path ="";
                $uploadfile = "";
                $i  = "";
                }  // file extention
                     else {
        $err= "Unable To Upload The File Please Check The File Extention.Try Again Later";
     }

                }
                }
                }



                } // if save close
  • 写回答

3条回答 默认 最新

  • douzi9744 2010-11-15 04:23
    关注

    You probably need to change the maximum POST size in your php.ini configuration file (post_max_size setting).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 蓝桥oj3931,请问我错在哪里
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染