I use the attached class to do ftp'ing with. I too wanted to get away from the DOS console. Just attach this class to your BWS project. I downloaded this off the net, and unfortunately I can't find the readme file that went with it. It's not too hard to figure out though. I do believe you'll need to add the WS32 1.0 Type Library reference to the project. I'm not 100% sure anymore though. You might want to test it. Anyway, here's a snippet of code that I use with this.
Dim Ftp As New clsFtp 'create a new ftp object
'Constants
'path and file name of the remote file
Const LH_FTP_FILE As String = "/data/luth/CONALLW"
'path and file name of the local file
Const LH_LOC_NAME As String = "x:\bws\ascentadjustments\data\lhn.txt"
'set the variables needed to connect to the server
Ftp.PSERVER = "ip address of server"
Ftp.PUser = "user"
Ftp.PPassword = "password"
'and connect to the server
Ftp.FCONNECT
'an example of getting a file
If Ftp.Connected Then
If Ftp.GetFile((LH_FTP_FILE, LH_LOC_NAME, ftAscii) = True Then
'successful, so do whatever; write to a log, set a function
value, whatever
Else
'it failed, so do whatever
End If
End If
(See attached file: clsFtp.cls)
I hope this helps. I'm sorry I'm a little fuzzy on the details anymore.
Henry Taylor
Applications Analyst
Lutheran Health Network
Ph. (260) 425-3914
|--------+--------------------------------->
| | "Benjamin, Morris" |
| | <[EMAIL PROTECTED]|
| | ealth.com> |
| | Sent by: |
| | [EMAIL PROTECTED]|
| | ATION.COM |
| | |
| | |
| | 04/01/2004 02:34 PM |
| | Please respond to Talk |
| | |
|--------+--------------------------------->
>-----------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: RE: [Talk] Script To FTP Files
|
>-----------------------------------------------------------------------------------------------------------|
Thank you for your response. I use a similar process also. I want to
bypass using the DOS console and run the program completely in Window's
environment, same as when you download a file form a website without
opening a DOS window.
Morris Benjamin
Programmer/Analyst
Daniel Freeman Hospital
310-448-7833
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 10:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [Talk] Script To FTP Files
Hi,
I have a Object script that runs a NPR report in Meditech, Encrypts it,
then FTP's it to a vendor,
here is the code.
yyyy = Year(Now())
mm = Month(Now())
dd = Day(Now())
a = yyyy & mm & dd & "A"
Encrypt_Line = "gpg -r securedata --always-trust --yes -o
c:\encrypted_to_send\survey_file_2.gpg -e
c:\survey_files\survey_file_2.txt"
FTP_Cmd = "put c:\encrypted_to_send\survey_file_2.gpg " & a & "c.gpg"
Set W = New WinScript
W.Connect "cmd", stConsole
M.Wait 0.5
W.Enter "c:"
M.Wait 0.5
W.Enter "cd\gnupg"
M.Wait 0.5
W.Enter Encrypt_Line
M.Wait 5
W.Enter "ftp"
M.Wait 5
W.Enter "open ftp.xxxxxxx.com"
M.Wait 5
W.Enter FTP_User_Name
M.Wait 5
W.Enter FTP_Pass_Word
M.Wait 5
W.Enter FTP_Cmd
M.Wait 10
W.Enter "bye"
M.Wait 2
W.Connect "", stConsole
It then runs the next NPR, and encrypts and ftps it.
Hope this helps
Bruce
"Benjamin, Morris"
<[EMAIL PROTECTED]>@BOSTONWORKSTATION.COM
on 04/01/2004 01:44:05 PM
Please respond to [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: [Talk] Script To FTP Files
I am looking for a script sample to FTP a file from a remote server
using IP Address of the server. I can do this process using the DOS
console. Does any one have a script using Windows? Thanks.
Morris Benjamin
Programmer/Analyst
Daniel Freeman Hospital
310-448-7833
clsFtp.cls
Description: Binary data
