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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Automatic file download

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-14 : 09:04:11
Hello guys,
I have a file that I have to download everyday thru https://, and I was thinking about setting up a job to automate that task. Is it possible? Do you guys have any scripts available?

Thanks!


I Love Challenges! That's why I love coding!

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-14 : 09:11:07
DTS has an FTP task, I don't know if it will work for HTTPS transfers though.

There's a neat little Unix utility called wget that lets you get any web page from the command line. There's a Windows version here:

http://unxutils.sourceforge.net/

There's a whole bunch of other Unix utilities that are very handy. As far as what you need, here's an example:

wget http://www.sqlteam.com/default.asp

Open a DOS command window and paste that in there and run it. You'll get a copy of the SQL Team home page on disk. Change the URL to one that you need.

As far as automating it, create a new job (not a DTS package). Add a new step of Operating System Command type. Paste the command into the Command box and save it. Schedule it anyway you like.
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-17 : 11:25:47
No, the FTP Task dosn't use any other protocol other than FTP.

And I'm using a Windows 2003 Machine + MS SQL 2000, I forgot to mention that.

Any other idea? SP?

I Love Challenges! That's why I love coding!
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-17 : 11:46:01
Wget works fine on every version of Windows.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-12-17 : 11:50:10
EDIT: see below, but look at the wget app first; that seems really easy ...

The Microsoft Internet Transfer control (MSINET.OCX; should in the system32 folder) lets you do this pretty easily. However, I had trouble creating an instance of the object using VBScript. I could do it easily setting a refernce using regular VB, but not using VBscript's CreateObject() function. (I probably am not using the correct class name, or it is not registered properly) (EDit #2: use SET x = CreateObject("InetCtls.Inet") in VB script)

Using the "Inet" object is really easy; you can specify the username/password, the protocol (https), and pretty easily download files by passing in any URL.



- Jeff
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-12-17 : 11:52:40
Rob -- cool link ! I will have to bookmark that site!

- Jeff
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-17 : 12:39:29
That seems easier, let me try and I'll reply.

Thanks a lot!

I Love Challenges! That's why I love coding!
Go to Top of Page
   

- Advertisement -