You are here: Re: download files from a website « All PHP « IT news, forums, messages
Re: download files from a website

Posted by lorento on 02/06/07 05:00

quick and dirty code :
<?php
$fp = fopen ("http://www.abc.com/abc.txt" ,"r");
$data = fread ($fp, 2048);
fclose ($fp);

$fp = fopen ("/home/data/abc.txt", "w");
fwrite ($fp, $data);
fclose ($f);
?>

http://www.mastervb.net/phpbooks/

On Feb 6, 5:20 am, "J.O. Aho" <u...@example.net> wrote:
> vivekmaha...@gmail.com wrote:
> > I dont know if I explained myself properly. Actually, suppose there is
> > a file located on a URL likewww.yahoo.com/gogo.txtand I want to
> > download gogo.txt from the yahoo website using php. How do I specify
> > that in PHP ??
>
> You can start with reading the following page,http://www.php.net/manual/en/function.fopen.php
> it will give the information you need on downloading a remote file and saving
> a file. When working with ftp/http protocols, you will need a wrapper that
> allows you to use those protocols with fopen().
>
> --
>
> //Aho

 

Navigation:

[Reply to this 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

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