Tip

Sending Text File That Contains Notes Documents to a Host That Has Notes on Unix

Instead of doing a manual FTP each time it's required, here is a scheduled agent that runs everyday and FTPs a text file to a Notes server at another location that has Unix as the O.S. I have used a batch file which is created in Notes and which actually accesses the destination server & exports the text file there. The batch file and the text file are assumed to reside in the same directory.


'CONSTANTS
'IP address of the destn host
Const gFTPDestnHost$ = "xxx.xxx.xx.x"
'UserID required to log on at the destn
Const gUserID$ = "UserID"
'Password required to log on at the destn
Const gPassword$ = "password"
'Name of the file to be exported.
Const ExportFileName$ = "ExportFile.txt"
'Path where the text file resides
'Const gSourceFilePath$ = "/xx/yy"
'FTP executable
'Const gFTPProgram$ = "ftp"

Sub Initialize
'Declarations
Dim FTPBatchFileNum As Integer
Dim FTPBatchFileName As String
Dim TaskID As Integer

'Creating a batch file that contains all the FTP commands to FTP the "ExportFile.txt" to the destination server whose host name is indicated in the constant gFTPDestnHost$ above
FTPBatchFilenum% = Freefile()
FTPBatchFilename$ = gSourceFilePath$ & "/" &
"FTP.bat"
Open FTBatchFileName$ For Output As
FTPBatchFileNum%

'Writing FTP commands to the batch file
Print #FTPBatchFileNum% "open" & " " &
gFTPDestnHost$
Print #FTPBatchFileNum% "user" & " " &
gUserID$ & " " & gPassword$
Print #FTPBatchFileNum% "put" & " " &
gSourceFilePath$ & "/" & gExportFileName$
Print #FTPBatchFileNum% "bye"
Close #FTPBatchFileNum%

'Shell command used to execute the FTP commands in the FTPBatchFileName$ created above.
TaskID% = Shell(gFTPProgram$ & " -I -v -n < "
& FTPBatchFileName$ , 6)

Exit Sub

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.