简体   繁体   中英

Wget download file using PHP exec

Is it possible to download a file using Wget? I want download that file into my default browser's download directory.

It's possible, but it wouldn't achieve the effect you desire.

Running wget would cause the file to be downloaded to the server (which is something you'd be better off using the cURL library for instead of shelling out to an external binary).

If you want the browser to download it, then you need to output the file from PHP, not save it to a file on the server.

尝试这样的事情:

shell_exec('wget -P path_to_default_download_directory google.com');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM