无法打开图片文件?

时间:2013-08-25 02:21:07

标签: php curl

我正在尝试使用cURL上传图片;但是,它似乎无法定位图像。在cURL请求日志中,我得到了这个:

  • 无法打开文件“pictures / 32408.jpg”

代码:

curl_setopt($ch, CURLOPT_URL, 'http://www.removed.com/upload');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, array(
        'image' => '@pictures/'. $id .'.jpg'
));

从这张图片中,您可以看到文件的结构:

enter image description here

如您所见,cURL创建的“request.txt”的位置在主目录中。然而,“@ / pictures / 32408.jpg”似乎不起作用?

0 个答案:

没有答案
相关问题