dongyuans61046 2017-07-05 02:52
浏览 57

使用curl通过.php文件加载src图像

Good day,

I'm loading my images from the third party server using curl. Some of the image is loading but some are broken then when I refresh it the broken image will load and some of the image that loaded before the refresh is now broken. I'm loading 50 or more items at a time.

header('Content-Type: image/png');
$formData=$_REQUEST;
$token=$formData['token'];
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_BINARYTRANSFER => 1,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => 'url'.$token,
    CURLOPT_HTTPHEADER=>array(
                        'Content-type: application/json',"Some key here"
                    )

));
$resp = curl_exec($curl);
curl_close($curl);
echo $resp;

Then here how I retrieve it

<img src='myURLHere?token=20170704-2a5793e6-97680a39.png'>

Am I missing something or there is just some configuration on apache server that I need to set?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看