VBScript Code to Connect to FTP Site

  • Would someone be able to provide me with example code of a VBScript (ActiveX) which does the following:

    1) Connects to an FTP Site,

    2) Verifies that the FTP Connection was successful,

    3) Checks to see if the files exist,

    4) If the files exist it downloads the files,

    5) If the files do not exist it Polls for 10 minutes and then checks to see if the files exist again.

    Thanks in advance,

    Kevin

  • I don't have any script to this in VB but I have scripted this type of thing using a product called WS_FTP (http://www.ipswitch.com/products/file-transfer.html)

    It is very simple to set up the first four steps to run automatically and the fifth step can be configured using windows scheduler, a SQL Agent job or similar.

    I know there is a bunch of other products out there that may be useful too that may help

    Hope this helps

  • I don't have anything specific, but a cheap way to do it without buying an extra product or installing additional software on your server is to use the windows built in ftp client.  I have done this in the past successfully.

    FTP will accept an input and output over-ride basically like FTP -s filename.txt 

    You can build the filename.txt ftp commands dynamically in the code.  You would then need look at the return values to determine the response.  The response is the first 3 digits of the line -- ie 200 Port Open.  General rule is that 2XX is good, 5XX is bad.

    I just did a quick search on the internet and found this site http://www.eggheadcafe.com/articles/20030923.asp  It may be able to help you with the generic vbscript.  However, you might not be able to do the "Scripting.FileSystemObject" on your server due to security restrictions.

    Good luck,


    Joe Johnson
    NETDIO,LLC.

  • I just have a deja vu

    Look at this thread


    * Noel

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply