drl92080 2011-10-19 05:19
浏览 71
已采纳

重定向的网址上的file_get_contents

I am using file_get_contents() on an image url which redirects to another image url. This results in a PHP error file_get_contents(www.modernpads.info/p/2161621.jpg) [function.file-get-contents]: failed to open stream: No such file or directory.

  1. Is there a way to get that image file even though the initial url redirects to another url?
  2. If the above cannot be done, how can I not return the PHP error and simply ignore it?
  • 写回答

1条回答 默认 最新

  • dongti7838 2011-10-19 05:23
    关注

    The redirect isn't your problem; it looks like the URL is missing an http scheme. Without the scheme, PHP thinks it's a file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图