2011-07-11 26 views

回答

1

不,move_uploaded_image移动在POST请求中上传的文件。

如果您想从URL中获取图片,您需要为其提供HTTP请求,例如,通过cURL

0

使用PHP的imagecreatefile_get_contentsfile_put_contents,您可以创建一个空白图像,从远程URL获取图像,然后替换您创建的空白图像。

类似,

// Create a blank image 
    $imPath = "path/to/your/desired/image.jpg"; 
    $im = imagecreatetruecolor(180, 151); 
    imagejpeg($im,$imPath); 

    // Download their fb image 
    $url = 'https://graph.facebook.com/' . $user['username'] . '/picture?type=large'; 
    $bytes = file_put_contents($imPath, file_get_contents($url)); 
0

有像move_uploaded_image没有功能。正确的功能是move_uploaded_file。

没有。您无法通过此功能获取图像文件。 该函数的第一个参数是通过Input type = file上传的临时文件名。

和另一种说法是要放文件的位置....

你应该参考PHP手册中_FILES $以获取更多信息.... http://php.net/manual/en/function.move-uploaded-file.php