Giter Site home page Giter Site logo

downloading image from api about rolling-curl HOT 5 OPEN

goldy619 avatar goldy619 commented on June 26, 2024
downloading image from api

from rolling-curl.

Comments (5)

bizonix avatar bizonix commented on June 26, 2024

It works fine

require __DIR__ . '/../src/RollingCurl/RollingCurl.php';
require __DIR__ . '/../src/RollingCurl/Request.php';
$rollingCurl = new \RollingCurl\RollingCurl();
$rollingCurl
    ->get('https://maps.googleapis.com/maps/api/streetview?size=400x400&location=taj%20Mahal&key=AIzaSyDTn9FYuxm3h3jKbEjwViHb7TKaCsXhUxI')
    ->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) {
        file_put_contents('taj Mahal.png',$request->getResponseText(),LOCK_EX);
    })->execute();

from rolling-curl.

goldy619 avatar goldy619 commented on June 26, 2024

no it is not.... the file created is empty(0 Byte) please check

from rolling-curl.

bizonix avatar bizonix commented on June 26, 2024

my friend google api just blocked your ip, try to change ip

from rolling-curl.

goldy619 avatar goldy619 commented on June 26, 2024

but i can view the image and file_get_contents() is working it does download the image....

from rolling-curl.

goldy619 avatar goldy619 commented on June 26, 2024

its working now the problem was with localhost i just uploaded is to one of my server and its working now... Thanks for your quick response... 👍

from rolling-curl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.