I use wget in php script and should get the name of the downloaded file.
For example, if I try
<?php
system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/');
?>
I get the index.html file in the download directory.
EDIT: The page will not always be Google, although the target may be an image or a style sheet, so I need to know the name of the downloaded file.
I would like to have something like this:
<?php
$filename = system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/');
?>
source
share