<bdo id='TJjgI'></bdo><ul id='TJjgI'></ul>

  • <small id='TJjgI'></small><noframes id='TJjgI'>

      <tfoot id='TJjgI'></tfoot>
      <legend id='TJjgI'><style id='TJjgI'><dir id='TJjgI'><q id='TJjgI'></q></dir></style></legend>

    1. <i id='TJjgI'><tr id='TJjgI'><dt id='TJjgI'><q id='TJjgI'><span id='TJjgI'><b id='TJjgI'><form id='TJjgI'><ins id='TJjgI'></ins><ul id='TJjgI'></ul><sub id='TJjgI'></sub></form><legend id='TJjgI'></legend><bdo id='TJjgI'><pre id='TJjgI'><center id='TJjgI'></center></pre></bdo></b><th id='TJjgI'></th></span></q></dt></tr></i><div id='TJjgI'><tfoot id='TJjgI'></tfoot><dl id='TJjgI'><fieldset id='TJjgI'></fieldset></dl></div>

        使用 cURL php 抓取图像

        Grabbing image with cURL php(使用 cURL php 抓取图像)

          <bdo id='QfeT8'></bdo><ul id='QfeT8'></ul>

          <legend id='QfeT8'><style id='QfeT8'><dir id='QfeT8'><q id='QfeT8'></q></dir></style></legend>

            1. <small id='QfeT8'></small><noframes id='QfeT8'>

                • <i id='QfeT8'><tr id='QfeT8'><dt id='QfeT8'><q id='QfeT8'><span id='QfeT8'><b id='QfeT8'><form id='QfeT8'><ins id='QfeT8'></ins><ul id='QfeT8'></ul><sub id='QfeT8'></sub></form><legend id='QfeT8'></legend><bdo id='QfeT8'><pre id='QfeT8'><center id='QfeT8'></center></pre></bdo></b><th id='QfeT8'></th></span></q></dt></tr></i><div id='QfeT8'><tfoot id='QfeT8'></tfoot><dl id='QfeT8'><fieldset id='QfeT8'></fieldset></dl></div>
                    <tbody id='QfeT8'></tbody>
                • <tfoot id='QfeT8'></tfoot>
                  本文介绍了使用 cURL php 抓取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  尝试使用 cURL 将图像保存到我的服务器.图像似乎正在下载.它显示了正确的字节,但是当我链接图像时不起作用.然后我 DL 看到并没有看到它的空白图像.

                  Trying to save image to my server using cURL. The image appears to download. It shows the correct bytes but when i link image does not work. I then DL to see and nope its a blank image.

                  这是我的代码...有什么问题?

                  here is my code... whats the issue with it?

                  $ch = curl_init("'. $image .'");
                  curl_setopt($ch, CURLOPT_HEADER, 0);
                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                  curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
                  $rawdata=curl_exec ($ch);
                  curl_close ($ch);
                  
                  $fp = fopen("$rename.jpg",'w');
                  fwrite($fp, $rawdata); 
                  fclose($fp);
                  

                  推荐答案

                  我测试了你的脚本,它对我来说很好,只需删除 $image 的无用双引号和点.

                  I test your script it work fine for me, just remove the useless double quote and dot for $image.

                  <?
                  $image ="http://cdn.sstatic.net/stackoverflow/img/sprites.png?v=5";
                  $rename="123";
                  
                  $ch = curl_init($image);
                  curl_setopt($ch, CURLOPT_HEADER, 0);
                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                  curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
                  $rawdata=curl_exec ($ch);
                  curl_close ($ch);
                  
                  $fp = fopen("$rename.jpg",'w');
                  fwrite($fp, $rawdata); 
                  fclose($fp);
                  ?>
                  

                  这篇关于使用 cURL php 抓取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                    <tbody id='uDQr4'></tbody>

                  <small id='uDQr4'></small><noframes id='uDQr4'>

                  • <bdo id='uDQr4'></bdo><ul id='uDQr4'></ul>

                        • <i id='uDQr4'><tr id='uDQr4'><dt id='uDQr4'><q id='uDQr4'><span id='uDQr4'><b id='uDQr4'><form id='uDQr4'><ins id='uDQr4'></ins><ul id='uDQr4'></ul><sub id='uDQr4'></sub></form><legend id='uDQr4'></legend><bdo id='uDQr4'><pre id='uDQr4'><center id='uDQr4'></center></pre></bdo></b><th id='uDQr4'></th></span></q></dt></tr></i><div id='uDQr4'><tfoot id='uDQr4'></tfoot><dl id='uDQr4'><fieldset id='uDQr4'></fieldset></dl></div>

                            <legend id='uDQr4'><style id='uDQr4'><dir id='uDQr4'><q id='uDQr4'></q></dir></style></legend>

                            <tfoot id='uDQr4'></tfoot>