title: wget embedded in php to download image
body: <p>From the command line, <code>wget <a href="http://mydomain.com/image.jpg" rel="nofollow">http://mydomain.com/image.jpg</a></code> successfully downloads the image.</p>
  
  <p>The image file size is 7KB.</p>
  
  <p>When I embed this code into <code>exec()</code>, <code>system()</code> or <code>passthru()</code>, such as</p>
  
  <pre><code>exec('wget http://mydomain.com/image.jpg');
  </code></pre>
  
  <p>or the same with <code>system()</code> or <code>passthru()</code></p>
  
  <p>The image gets created but only has 255 bytes...</p>
  
  <p>Can anybody tell me why this happens?</p>