Page 1 of 1

download file from hyperlink

Posted: Wed Jun 28, 2006 3:50 pm
by mcog_esteban
hello.
i'm trying to build a simple script to download the latest uploaded files from a site.
Ex. Instead of visiting a web site and click on the link to download the file, i just run the script.

Can someone give a few tips or pseudo code?
thanks.

Posted: Wed Jun 28, 2006 4:27 pm
by andym01480
How about...

Code: Select all

ob_start();
include ("urlwanted");
$output = ob_get_contents();
ob_end_clean();
That would put the contents of urlwanted into the variable $output without outputting it to your browser. You can then write it to a file or process it as wanted

Posted: Thu Jun 29, 2006 3:36 pm
by mcog_esteban
hum...
using this, how would i get the name of the file?

thanks for the idea.