發佈圖像目前,上傳本地文件夾中的圖像我使用捲曲和PHP,這裏是我的代碼:PHP捲曲從URL
$url = 'http://myprestashop.com/api/images/products/1';
$image_path = 'C:\\my_image.png';
$key = 'My web service key';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_USERPWD, $key.':');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => '@'.$image_path));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
我怎樣才能員額從URL(http://imageserver.com/image.jpeg)圖像,而不是本地文件夾( C:\ my_image.png)?可能嗎?
我覺得你需要這樣。從prestashop.com得到迴應,當你顯示curl需要顯示你的圖像從其他服務器,如果我是正確的,那麼它可能 – 2014-08-29 05:03:11