English 中文(简体)
使用php载大载体吗?
原标题:Upload Large Files using php?

I need to upload a large file (up to 190mb) Here is server details for limit:

memory_limit = 50M
post_max_size = 192M
file_uploads = On
upload_max_filesize = 192M 
max_execution_time = 1800 sec
max_input_time = 1800 sec

我的守则是:

 $query="update tbl_Cards set CardName= $cardname ,Description= $Description ";
    if($cardvideo)
    {
      if($_FILES["cardvideo"]["type"] == "video/quicktime"||$_FILES["cardvideo"]["type"] == "video/mov"||$_FILES["cardvideo"]["type"] == "video/mp4"||$_FILES["cardvideo"]["type"] == "video/mpv"||$_FILES["cardvideo"]["type"] == "video/3gp")
      {
        if($_FILES["cardvideo"]["size"]<=10485760)
        {
          $cardvideo=$date."card.mp4";
          $tmppath3="services/video/".$cardvideo;
          if(move_uploaded_file($_FILES[ cardvideo ][ tmp_name ],$tmppath3))
          {
          $thumb=$date.".jpg";
          $thumbDirectory="services/VideoCapturePic/";
          exec("convert "{$tmppath3}[0]" -colorspace RGB -geometry 200 $thumbDirectory$thumb");
          $query.=",Video= $cardvideo ,CapturePic= $thumb ";
        }
        $query.="where CardId= $card ";

        $result=mysql_query($query);
        if($result)
        {
        } else
        {
        echo mysql_error();
        }

但是,当我上载10平方米的档案时,如果我试图上载大量档案(20或30或40或50)的话,我得到这一答复:

Column count doesn t match value count at row

我做了什么错误?

问题回答

Its not just the php.ini, but server also can restrict your request size. Though by default in apache its not set to limit the file size, but I think you should check for that once. LimitRequestBody directive is used to restrict the request size. Check for the directive in all your configuration files (I am assuming that you are using apache) and change the value for your directory. Sample usage:

<Directory "/var/www/vhost/mydir/uploads">
    LimitRequestBody 204444344
</Directory>




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签