Ask a Question related to PHP Programming, Design and Development.

  1. #1

    Default wget in php?

    I was wondering that is it possible to like write a php script to wget files? ...

    Like so people type the url in of the file, and it transfers it over to the server.
    --
    If not wget, something simular.

    Is this possible? .. IF so be good for my entertainment site, save me from downloading, then uploading. Just one simple transfer!
    trytertqwr is offline Banned
    Join Date
    Aug 2011
    Posts
    23

  2. Similar Questions and Discussions

    1. CPAN, LWP and Net:FTP firewall issues? Connection established transfer fails, yet ftp and wget work manual.
      I assume this is a firewall issue, but seeing I'm new to perl I'm not sure what the problem is. I have Perl 5.8.00 installed on RedHat 8.0 with...
    2. Help installing wget
      I need to install wget on a server that I have a domain on. But I do not understand where to upload the files and then how to install wget to get...
    3. Lynx and wget - redirect problems for PHP scripts
      I have a PHP script that should be run a few times a day. Currently I run this script manually as I haven't been able to set up Lynx or wget to run...
    4. restarting wget?
      If wget fails partway through recursively downloading a big website, is there some way to start it over again, to have it download the rest of the...
    5. rsync or wget?
      Hi group, I've just installed apt-proxy. Should I use rsync or wget for fetching packages? I don't really understand the differences. I do...
  3. #2

    Default Re: wget in php?

    You can use file_get_contents() function to fetch contents of a remote file using PHP.

    http://php.net/manual/en/function.file-get-contents.php

    You can use wget or any linux shell command using exec() or system() function. I do not recommend using exec() and system() due to security risks.

    You can use this code to download a remote file using wget:

    PHP Code:
    <?php
    exec
    ('wget http://www.remote.com/file.txt');
    ?>
    Ravish is offline S U P E R U S E R
    Join Date
    Aug 2006
    Location
    Internet
    Posts
    21

  4. #3

    Default Re: wget in php?

    thanks for sharing such nice information about php. Keep it up with same passion.
    honeyclarck is offline Member
    Join Date
    Feb 2012
    Location
    UK
    Posts
    35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139