![]() |
|
Snippets |
|
Download an image via sfWebBrowser and save it as-is or turn it into a thumbnail.
$b = new sfWebBrowser(); $b->get('http://foo/images/bar.gif'); // create thumbnail $thumb = new sfThumbnail(150, 150); $thumb->loadData($b->getResponseText(), $b->getResponseHeader('Content-Type')); $thumb->save('/home/foo/bar.gif'); // just store the file - don't make thumbnail file_put_contents('/home/foo/bar.gif', $b->getResponseText());