download file from hyperlink

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

download file from hyperlink

Post 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.
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

Post 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
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

Post by mcog_esteban »

hum...
using this, how would i get the name of the file?

thanks for the idea.
Post Reply