如何上传远程图片啊,
程序员文章站
2022-05-23 23:53:30
...
include_once('upyun.class.php');
$fb=fopen('http://www.baidu.com/img/bdlogo.png','rb');
$filename='/video/test.jpg';
$upload = new UpYun('test', 'test', 'test123');
$upload ->writeFile("$filename", $fb, True);
fclose($fb);
我上传完报错什么原因呢,
回复内容:
include_once('upyun.class.php');
$fb=fopen('http://www.baidu.com/img/bdlogo.png','rb');
$filename='/video/test.jpg';
$upload = new UpYun('test', 'test', 'test123');
$upload ->writeFile("$filename", $fb, True);
fclose($fb);
我上传完报错什么原因呢,
已经解决了:
include_once('upyun.class.php');
$fb=file_get_contents('http://www.baidu.com/img/bdlogo.png');
$filename='/video/test.jpg';
$upload = new UpYun('test', 'test', 'test123');
$upload ->writeFile("$filename", $fb, True);
fclose($fb);