ruchong 发表于 2011-05-16 16:23

lighttpd php 传输文件....

传输大文件20M左右, 已经修改php.ini
post_max_size = 1024M
upload_max_filesize = 1024M

但是传输成功后, 先收到200, 然后又收到414, 小文件没有此问题...
FILE = HttpUpTrans.cpp LIEN = 61 dataBuffer = HTTP/1.1 200 OK^M
Content-type: text/html^M
Transfer-Encoding: chunked^M
Date: Mon, 16 May 2011 16:18:33 GMT^M
Server: lighttpd/1.4.28^M
^M
c5^M
Upload: core_779e862b-022f-413c-a797-cee8403b23e5<br />Type: text/plain<br />Size: 41225.680664062 Kb<br />Temp file: /tmp/phpADvoUS<br />Stored in: upload/core_779e862b-022f-413c-a797-cee8403b23e5^M
0^M
^M
nd pHt1^B


FILE = HttpUpTrans.cpp LIEN = 61 dataBuffer = HTTP/1.0 414 Request-URI Too Long^M
Content-Type: text/html^M
Content-Length: 367^M
Connection: close^M
Date: Mon, 16 May 2011 16:18:33 GMT^M
Server: lighttpd/1.4.28^M
^M
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>414 - Request-URI Too Long</title>
</head>
<body>
<h1>414 - Request-URI Too Long</h1>
</body>
</html>

php脚本如下:<?php
if ($_FILES["file"]["error"] > 0)
{
    echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
    if (file_exists("upload/" . $_FILES["file"]["name"]))
    {
      echo $_FILES["file"]["name"] . " already exists. ";
    }
    else
    {
      move_uploaded_file($_FILES["file"]["tmp_name"],
                "upload/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
    }

}
?>多谢....
页: [1]
查看完整版本: lighttpd php 传输文件....