Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Downloading external image

General discussions related to php

Moderators: macek, egami, gesf

Downloading external image

Postby Knutsford » Wed Oct 03, 2012 6:56 am

In php how do you download an resize an external image - eg ... 390021.jpg
My code is failing on

if (file_put_contents($image, file_get_contents($url))) {

and file_get_contents is returning the binary


$url = trim($AnItem[1]);

if (file_put_contents($image, file_get_contents($url))) {
$thumb = imageToCanvas($image,100,75,true);
$medium = imageToCanvas($image,400,300,true);
$large = imageToCanvas($image,800,600,true);// 800x600
imagejpeg($thumb,$base_image_path . $thumb_path,90);
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Mar 01, 2012 8:08 am

Return to PHP General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.