想得到upfile的数据,可以这样做:
在first.html中:
<form name="form1" action="put.php">
<input type=file name=upfile >
<input type="submit" name="bu1">
</form>
在put.php中就可以取得upfile的值:
<?echo $upfile?>

解决方案 »

  1.   

    我也遇到同样的问题.
    都有提交上去.
    可是到第二页就是得不到upfile这个值.
      

  2.   

    $_FILES["upfile"]["name"]

    $HTTP_POST_FILES["upfile"]["name"]
      

  3.   

    <form name="form1" action="put.php" enctype="multipart/form-data">
      

  4.   

    php 的版本问题 4.0 以上要用 $_FILES["upfile"]["name"]
      

  5.   

    你是说PHP 4 以上的都要用$_FILES["upfile"]["name"]来读数据?
      

  6.   

    忘了问了那个["name"]里的参数name是指什么?
      

  7.   

    //test to make sure got a file
    if(!is_array($HTTP_POST_FILES['file1']
    {
        print('<html><body>You didn't upload a file</body></html>');
        exit;
    }//If we got here, we must've gotten something
    $f=&$HTTP_POST_FILES[]file1'];
    $dest_dir='upload';
    $dest=$dest_dir.'/'.$f['name'];//make sure we can actually put the file where it's supposed to go
    if(!is_uploaded_file($f['tmp_name']))
    {
        print('<html><body>Error:No file upload</body></html>');
        exit;
    }
    if(!file_exists($dest_dir))
    {
        print('<html><body>Error:Destination directory"'.$dest_dir.'"does not exist!</body></html>');
        exit;
    }
    if(!is_dir($dest_dir))
    {
        print('<html><body>Error:Destionation directory"'.$dest_dir.'"is not a directory!</body></html>');
        exit;
    }
    if(file_exists($dest))
    {
        print('<html><body>Error:File"'.$dest.'"already exists!</body></html>');
        exit;
    }//all clear,move the file to its permanent location
    $r=move_uploaded_file($f['tmp_name'],$dest);
    if($r==false)
    {
        print('<html><body>Error:Could not copy file to "'.$dest.'"</body></html>');
        esit;
    }
      

  8.   

    <form name="form1" method="post" action="up.php" enctype="multipart/form-data" >
    enctype="multipart/form-data"加了没有???