不能在PHP 5.5中使用已弃用的API

时间:2016-07-10 19:54:05

标签: php curl

我正在尝试使用反向设计的Instagram API将图像上传到Instagram。在我的代码中,我有这个部分:

$data = [
  'device_timestamp' => time(),
  'photo' => '@' . $filename
];
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);

但这引发了这个错误:

Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead

我知道我可以使用CURLFile,但Instagram API不支持此功能。我需要使用PHP 5.5中所谓的“@filename API”。我怎样才能做到这一点?这种弃用是否有解决方法?

0 个答案:

没有答案