title: Downloading png to disk creates broken file
body: <p>In my project, I want to download a png file from a url and save it to disk.</p>
  
  <p>I have a url to an image, and I can load it in my web browser without any problem.
  But when I use Access to download this file and save it, it saves "a" file, but it doesn't seem to have any image.  Every file it creates is 167kb, and I cannot view them with my graphics viewers (XnViewMP, for example).</p>
  
  <p>When I load the created file with PE Studio, it says the MZ signature is missing (I'm not sure that means anything).</p>
  
  <p>I've tried this with an .ico file on my local webserver, too, and have the same issue.</p>
  
  <p>Here is the code I'm using to download the image file.</p>
  
  <pre><code>Public Function DownloadFile(whaturl As String, whatdestination As String) As Boolean
  
      Dim newfilepath
      Dim success As Boolean
  
      Dim WinHttpReq: Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
      WinHttpReq.Open "GET", whaturl, False
      WinHttpReq.Send
  
       If WinHttpReq.Status = 200 Then
          Dim oStream: Set oStream = CreateObject("ADODB.Stream")
          oStream.type = 1    '1 is binary
          oStream.Open
          oStream.Write WinHttpReq.ResponseBody
  
          oStream.SaveToFile whatdestination, 2 ' 1 = no overwrite, 2 = overwrite
          oStream.Close
          success = True
      Else
          success = False
      End If
  
      DownloadFile = success
  
  End Function
  </code></pre>
  
  <p>Maybe someone can tell my why this code seems to fail in downloading the png file?  I've tried with an .ico file, too, and have the same problem.  Maybe someone can help me with this code?</p>