换成$uploaddir="productimgs";
也不行

解决方案 »

  1.   

    你把
    $smallimg
    uploaddir/$smallimg.gif
    都打出来看看
      

  2.   

    打出来的:
    ./productimgs
    C:\WINNT\TEMP\php17F.tmp
      

  3.   

    copy(../productimgs/smallimg/C:\WINNT\TEMP\php11F.tmp.gif):
    看这句就知道路径肯定不对了啊
    你是不是用表单上传的图片,是的话图片名用$_FILES['photo']['name']获得
      

  4.   

    $_FILES['photo']['name']中photo是什么东西?name是图片名字吗?
      

  5.   

    Warning: copy(./productimgs/largeimg/.gif): failed to open stream: No such file or directory in D:\Inetpub\wwwroot\upload22\admin\adm_addproduct.php on line 52
    .gif./productimgs/largeimg
      

  6.   

    <?
    if ($_POST)
    {
    $uploaddir = './datafile/';
    $uploadfile = $uploaddir.$_FILES['userfile']['name'];
    echo $uploadfile;
    echo "<br>";
    echo $_FILES['userfile']['tmp_name'];
    echo "<br>";
    echo  $uploaddir . $_FILES['userfile']['name'];
    print "<pre>";
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) {
       print "File is valid, and was successfully uploaded.  Here's some more debugging info:\n";
       print_r($_FILES);
    } else {
       print "Possible file upload attack!  Here's some debugging info:\n";
       print_r($_FILES);
    }
    print "</pre>";
    }
    else
    {?>
    <form enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
    </form><?
    }
    ?>