Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
enslinb
Starting Member
4 Posts |
Posted - 2015-04-30 : 08:35:23
|
HiI'm trying to - download all the files on a webpage where the file name is like "cust_interact" (eg cust_interact.0815, cust_interact.0615)(or even better, read the file date and only download today's)- save it locally with file name and dateThey are not in a specific folder but directly under http://web.address.co.za/products/scriptresults/. They're in the root directoryThis is my code, which naturally makes total sense to me and only me!Public Sub Main() Dim strtemp As String = "\\Server\folder\folder2\folder3\CustInteraction" Dim strsource As String = "http://web.address.co.za/products/scriptresults/" Dim webunibase As New WebClient Dim strdestnew As String = InStr(1, "cust_interact", strsource) Dim strdest As String = strtemp + Date.Now.ToString("yyyyMMddhhmm") + ".csv" For Each strdest In strdestnew webunibase.DownloadFile(strsource, strdest) Next Dts.TaskResult = ScriptResults.Success End SubThanks! |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-04-30 : 10:19:22
|
Good for you! Though I would probably not hard-code the source or destination strings, but rather pass them to the script as variables which are configurable via SSIS Package Configurations. |
|
|
|
|
|