开发者

WGET output to local drive us PHP system()

Is it possible to save the files retrieved by WGET to the "client side" using PHP system() function?

Test based on djechelon answer:

$targetfile = "C:\Work\test.css";

$url = "http://www.domain.com/temp/style.css";

$foo = system('wget $url >开发者_开发技巧 $targetfile');


What do you mean by "local drive"? The client that's viewing the website that's displaying the contents of your PHP script? If yes - then after downloading a file with wget you need to force the browser to re-download it from YOUR website to their computer. You can do this by saving the wget file into the public html directory and providing a link via php, or by sending a php command

header('Location: '.$file);

Good Luck!


system('wget $url > $targetfile');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜