Reply to Re: Image Download

Your name:

Reply:


Posted by Rik on 05/20/06 18:29

funkychicken818@gmail.com wrote:
> Hey well i need help i want to create a simple image downloading
> script where you insert the image URL and it will download it and
> place it on your server, and rename the image to some number. Any one
> have any ideas on how i can do this?

"simple" and "place it on the server" don't really mix if you want the
script to be save (you could end up with malicious content on your
server...)

Without the security, your script could be like this though (PHP > 4.3.0):

$url = "http://some/url/of/image.jpg";
preg_match('"(\.[^/]+)$"', $url, $match);
$extension = (isset($match[1])) ? $match[1] : '';
$int = 'your_number';
$handle = fopen($url, 'r',);
copy($handle, '/path/on/your/server/'.$int.$extension);

Grtz,
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация