Uploading a .xml file to a FTP site from WB

Exciting new Business Rules announcements!
(Outgoing messages only)

Moderators: Susan Smith, admin, Gabriel

PJKLUG
Posts: 27
Joined: Tue Jun 09, 2009 9:29 am

Uploading a .xml file to a FTP site from WB

Postby PJKLUG » Fri Jan 20, 2012 1:18 pm

I need to automate the posting of an .xml file created in WB directly into an FTP site.

Hopefully someone has already done this. Is there an FNGeorge function for this? (Just hoping!)

Pete

John
Posts: 550
Joined: Sun Apr 26, 2009 8:27 am
Location: West Orange, NJ
Contact:

Postby John » Fri Jan 20, 2012 4:25 pm

from the command line do a
FTP /?
That will tell you the basics - a simple shell call ... or perhaps batch file should do the job for you. You can do it all from the windows command line.

David's function may have even better bells and whistles and features etc - most things he does are pretty great, but the task is relatively simple. I made a function to do it once a dozen years ago which I may also be able to fish up... i remember my complication was that the batch file had to be slightly different to work on windows 98 machines... I assume you won't care about this. LOL

-John Bowman

gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Postby gtisdale » Fri Jan 20, 2012 4:56 pm

I use Core FTP Lite to do this with a command line call in BR. The program checks to see if the file to be uploaded exists, it then calls Core FTP witha site name. ThE ftp address andpassword are retrieved from the Core database. If the transfer is successful, some times it is not, Core knows this and deletes the transfer file and writes an entry in a log file. If it is not successful a log entry is made but the file is not deleted. That way I can just try it again and again until it is sucdessful.

Code: Select all

00010 ! replace prsysc\upldACH
00020 ! program activates a batch file and uploads ACH file
00025 EXECUTE "PROC *:vol002\tt"
00030 IF EXISTS("prdatc\achupload.bat") THEN GOTO 50
00040 GOTO EOJ
00050 IF EXISTS(ENV$("PD")&"efile\AAICPAY1")=2 THEN GOTO 70
00060 GOTO EOJ
00070 IF MSGBOX("Continuing will transfer the current ACH file to the bank.  If direct deposit transactions are in the bank the charge MAY occur immediately.  Do you want to continue?","Upload ACH","Yn","QST")=2 THEN GOTO 80 ELSE GOTO EOJ
00080 EXECUTE "sys -w prdatc\achupload"
00090 IF (EXISTS(ENV$("PD")&"wb\efile\AAICPAY1")=2 AND MSGBOX("The transmission file has not been deleted.  This indicates that the transmission of ACH information failed."&CRLF$&CRLF$&"Do you want to try again?","Transmission Failed",YN$,"EXCL")=2) THEN GOTO 80
00100 IF EXISTS("efile\ACHLOG.txt")=2 THEN
00110   LET LOGTXT=10
00120   IF FILE(LOGTXT)>-1 THEN LET LOGTXT+=1 : GOTO 120
00130   LET LOGFIL=LOGTXT+1
00140   IF FILE(LOGFIL)>-1 THEN LET LOGFILE+=1 : GOTO 140
00150   OPEN #LOGTXT: "name=efile\achlog.txt",DISPLAY,INPUT
00160   OPEN #LOGFIL: "name=efile\achlog.log,use",DISPLAY,OUTPUT
00170   LINPUT #LOGTXT: A$ EOF XXX
00180   PRINT #LOGFIL: TRIM$(A$)
00190   GOTO 170
00200 XXX: CLOSE #LOGTXT,FREE:
00210   LET LOGTXT=0
00220   CLOSE #LOGFIL:
00230 END IF
00240 DIM POST$*20,A$*500
00250 LET POST$="efile\achlog.log"
00260 CHAIN ENV$("PD")&"vol002\viewback.br",POST$
00265 GOSUB SHOW_HELP
00270 EOJ: LET MENU_NAME$=ENV$("MENU_NAME") : LET MENU_SEQ$=ENV$("MENU_SEQ") !:
      CHAIN ENV$("PD")&"workmenu.br",MENU_NAME$,MENU_SEQ$


The Batch file is

Code: Select all

del L:\wb\efile\achlog.txt
if exist "C:\Program Files\CoreFTP\coreftp.exe" goto XP
:VISTA
"C:\Program Files (x86)\CoreFTP\coreftp.exe" -u L:\wb\efile\AAICPAY1 -site "CitizensBank ACH" -delsrc -output L:\wb\efile\ACHLOG.txt
goto END
:XP
"C:\Program Files\CoreFTP\coreftp.exe" -u L:\path\AAICPAY1 -site "SITE NAME" -delsrc -output L:\path\ACHLOG.txt
goto END
:END
rem copy L:\wb\efile\achlog.log+L:\wb\efile\ACHLOG.txt L:\wb\efile\achlog.log


Hope this is what you are looking for.
FNGeorge


Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 2 guests

cron