Frank:

I think this may be able to be done without using any special FTP client,
just the FTP program in Windows.  Here is some sample code that I use to
interactively prompt for a file name and then R:Base commands and batch
files take care of the rest.

R:Base file named FILETRFR.RMD
--
DIALOG 'Enter the file name to transfer' vresponse vendkey 1 AT 10,10
--
SET VAR vfile_cmd TEXT = ('get' & .vresponse)
--
CREATE TEMPORARY TABLE ftp_cmd (COMMAND TEXT 20)
--
INSERT INTO ftp_cmd * VALUES 'mar'  (user name)
--
INSERT INTO ftp_cmd * VALUES 'fdg05ryn' (password)
--
INSERT INTO ftp_cmd * VALUES 'lcd d:\rbase\data' (change to desired
directory)
--
INSERT INTO ftp_cmd * VALUES .vfile_cmd (command created by above code)
--
INSERT INTO ftp_cmd * VALUES 'quit' (quit command for FTP file)
--
SET SELMARGIN 1
--
SET HEADINGS OFF
--
OUTPUT filetrfr.txt (output to file)
--
SELECT * FROM ftp_cmd (add commands from table to file)
--
OUTPUT SCREEN (output to screen)
--
SET HEADINGS ON
--
SET SELMARGIN 0
--
SET VAR vcomspec TEXT = (ENVVAL('COMSPEC'))
--
ZIP &vComSpec /C filetrfr (run batch file with data created above)
--
CLEAR VAR vcomspec, vfile_cmd, vresponse, vendkey
--
DROP TABLE ftp_cmd
--
RETURN

-- End FILETRFR.RMD


-- Sample file named FILETRFR.TXT which is created by FILETRFR.RMD

mar
fdg05ryn
lcd d:\rbase\data
get product.srt
quit

-- End FILETRFR.TXT

-- Batch file name FILETRFR.BAT that uses commands in FILETRFR.TXT

ftp -i -s:filetrfr.txt 000.000.000.000 (IP address or server name to FTP to)

-- End FILETRFR.BAT

The above files are set up to run interactively but you could certainly
totally automate this with a few minor adjustments.

Hope that helps.

Mike Ramsour

-----Original Message-----
From: Betaserver [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 12, 2005 11:28 AM
To: [email protected]
Subject: [RBG7-L] - Automate FTP Uploads with RBase ?


I have a very large customer who has us sending them ASCII delimited data
files for them to upload into their SQL server. Easy enough, and I have an
automated code that  emails them the files, no user interaction.  Now they
want to "automate" the process more on their end.  They want us to FTP the
files to their system.  Well I can do this using one of the FTP clients I
have, but this is manual on our end and I would like to automate the FTP so
that our users can just click a button on RBase and it goes automatically.
I have been looking at some FTP clients that use VB scripts or ASP that with
some editing could probably do this. But I wanted to throw it out here to
see if anyone else has done this before with RBase and what FTP client they
recommend, and maybe even what their code/script looks like for making this
automated and require no user interaction.

This would be RBase 7.1 on Windows 2003 server.  

-- Frank Taylor, Systems Network Administrator
-- F.J. O'Hara Corp, Boston, MA
-- [EMAIL PROTECTED] - 617-790-3093

Reply via email to