Have an account? / Register

Forgot your password?

Forgot your username?

Results 1 to 4 of 4

Thread: how to download photos from a datafeed

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    how to download photos from a datafeed



    Hello all,

    I'd like to save the photos from a datafeed to my server in order to prevent any downtime.

    Can anyone advice me on how to do this ?

    thanks a lot

  2. #2
    Registered User SimonQuick's Avatar
    Join Date
    Dec 2008
    Posts
    270
    Thanks
    6
    Thanked 21 Times in 21 Posts

    Re: how to download photos from a datafeed

    Hi lemon2x,

    You could do it with a file_put_contents function

    Something like:

    <?php
    //name of file to save to
    $filename = "text.jpg";

    //url of image
    $url = "http://www.affiliates4u.com/system/media/logo_beta.jpg";

    //download and write contents of url
    file_put_contents($filename, file_get_contents($url));

    ?>

    Hope that helps.

    Thanks
    Simon
    Simon Quick
    Data Quality Manager, buy.at
    simon.quick@buy.at || Twitter: http://twitter.com/BuyAtFeeds

  3. #3
    Ex-User scriptmonkey's Avatar
    Join Date
    Jan 2009
    Location
    Back home in North Wales
    Posts
    1,742
    Thanks
    128
    Thanked 307 Times in 230 Posts

    Re: how to download photos from a datafeed

    And, to make sure that you don't download it if you already have it

    replace

    PHP Code:
    file_put_contents($filenamefile_get_contents($url)); 
    with

    PHP Code:
    if (!file_exists($filename)) {
    file_put_contents($filenamefile_get_contents($url));

    I've left the forum to farm sheep and cattle.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: how to download photos from a datafeed

    thanks a lot guys....great place to be as always

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Day One Photos
    By Matthew Wood in forum PerformanceIN Events
    Replies: 12
    Last Post: 21-10-08, 02:37 PM
  2. CJ simple datafeed download ? Help please !
    By aotagain in forum Affiliate Marketing Lounge
    Replies: 2
    Last Post: 12-09-08, 04:02 PM
  3. Free Photos
    By tomtomtomtomtom in forum Affiliate Marketing Lounge
    Replies: 5
    Last Post: 20-06-03, 01:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

SEO by vBSEO 3.6.1