dbTalk Databases Forums  

DTS: Download file from HTTP server

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS: Download file from HTTP server in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
xgoulay@gmail.com
 
Posts: n/a

Default DTS: Download file from HTTP server - 12-08-2005 , 03:28 AM






I would like to download a file from an HTTP server. Is there a way
with DTS to download a file from a webserver as we can do it from an
FTP server using the FTP task provided?


Reply With Quote
  #2  
Old   
Dave
 
Posts: n/a

Default RE: DTS: Download file from HTTP server - 12-08-2005 , 03:48 PM






Try this,

'************************************************* *
' Visual Basic ActiveX Script
'************************************************* *
Option Explicit

Function Main()

Dim mInternet, mFile, mFiletxt, fso, WebAddress

WebAddress = "http://www.microsoft.com"

Set mInternet= CreateObject("Microsoft.XMLHTTP" )

mInternet.open "GET" , WebAddress, false
mInternet.send
mFiletxt= mInternet.Responsetext
set mInternet = nothing

set fso = createObject("scripting.FilesystemObject")

set mfile = fso.createtextfile("C:\myfile.html")
mfile.write mfiletxt
mfile.close

set mfile = nothing
set fso = nothing

Main = DTSTaskExecResult_Success
End Function




"xgoulay (AT) gmail (DOT) com" wrote:

Quote:
I would like to download a file from an HTTP server. Is there a way
with DTS to download a file from a webserver as we can do it from an
FTP server using the FTP task provided?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.