title: How to download a file with a script Task in SSIS
body: <p>I am struggling to use below vba in SSIS script Task. Basically it downloads a file from web and saves it on a shared drive . File is then loaded in SQL server.I have tried the code and it works in Excel VBA.I have modified the URL for security purposes. Below is just an example</p>
  
  <pre><code>`Const MYURL = "https://123.123.co.uk&amp;filename=Test.xls"
  
   Sub DataScraping()
  
  Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
  objHTTP.Open "GET", MYURL, False
  objHTTP.SetCredentials "1234", "1234", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
  
  objHTTP.Send
  
  Set oStream = CreateObject("ADODB.Stream")
  oStream.Open
  oStream.Type = 1
  oStream.Write objHTTP.ResponseBody
  oStream.SaveToFile ("\\C\files\Test\file13 " &amp; Format(Now(), "ddMMyyyy 
  HHmmss") &amp; ".xls")
  oStream.Close
  End Sub'
  </code></pre>