URL?如果目标文件名可以是url的话,那么互联网早就不存在了

解决方案 »

  1.   

    楼主要是上传url文件的话,可以使用copy来实现!
      

  2.   

    $filename 好只能是相对路径
    就算可用绝对路径你的也不对啊
    $filename=http://127.0.0.1/1/kk.jpg,忘了加引号了看下范例:
    <?php
    // 在 4.1.0 以前的 PHP 中,需要用 $HTTP_POST_FILES 代替 $_FILES。
    // 在 4.0.3 以前的 PHP 中,需要用 copy() 和 is_uploaded_file() 来代替 move_uploaded_file()。$uploaddir = '/var/www/uploads/';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);
    }?>