0

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

Laurel
  • 5,965
  • 14
  • 31
  • 57
  • possible duplicate of [wget command to download a file and save as a different filename](http://stackoverflow.com/questions/16678487/wget-command-to-download-a-file-and-save-as-a-different-filename) – Laurent S. Jan 15 '15 at 10:52
  • i want to download it into default download directory using php.And it will work as a normal file download –  Jan 15 '15 at 10:54
  • Browser is client-side. PHP is server-side. There is something wrong with your request... – Laurent S. Jan 15 '15 at 11:01

2 Answers2

0

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.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

Try something like this :

shell_exec('wget -P path_to_default_download_directory google.com');
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
Rahul Shandilya
  • 126
  • 1
  • 6