Focal Point
FTP a file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7731078331

June 27, 2005, 07:52 PM
<lnguyen>
FTP a file
I am trying to FTP a file through report caster but im not sure what im doing is correct. but basically, i wrote a SQL query that writes out a file typically about 28mb or so.. I have an ip address which i FTP the file to an outside vendor. could someone possibly tell me how to do this because im not coming up with anything

thanks

Long
July 08, 2005, 03:10 PM
Kerry
Hi Long, is still still an issue for you? Have you tried the search on Focal Point posts?

My suggestion on this would be, it may be more efficient to contact IBI Tech Support Help Desk and open a new case regarding this issue. It looks like that this is a configuration problem. We will need to know more details about the product you are using and etc.

To open a new case with Tech Support Help Desk, you can either call at 1-800-736-6130, or via InfoResponse online. Be sure to have your information at hand.

Hope this helps. Big Grin

Cheers,

Kerry
July 11, 2005, 05:54 AM
susannah
-* make a file of ftp commands and run it
-* this is the focus code that i use embedded in my fex, and it runs in caster; when you schedule the fex, do NOT choose FTP as the output type.
Just pick something benign like HTML and EMAIL it to yourself. Since your output is not html, nothing will happen, which is fine.
-* fyi, the command lcd is local change directory
-* which works on the ftp site. the command cd would work on the server side, if you need to move around to locate your source file.
-* and the file put.ftp is being made in the agent, so doesn't get saved anywhere. its just temporary. I'll assume that your source data file is in the agent, as well. otherwise you may need to use some cd commands to move around and locate it.
FILEDEF CHFTP DISK PUT.FTP
FILEDEF MYFILE DISK D:\....\MYFILE.TXT
-RUN
-WRITE CHFTP open ftp.yoursite.com
-WRITE CHFTP youruserid
-WRITE CHFTP yourpassword
-WRITE CHFTP ascii
-WRITE CHFTP lcd \
-WRITE CHFTP lcd yourdestinationdiretoryname
-*WRITE CHFTP get myfile (this line would get the file from ftp
-WRITE CHFTP put myfile
-WRITE CHFTP close
-WRITE CHFTP quit
-RUN

DOS ftp -i -s:PUT.FTP
-RUN
-* that should do it for you. of course if your put file is always named the same, you can just hardcode these ftp commands into a file somewhere and then just run the DOS command from some fex scheduled via caster. In some installations, the DOS command doesn't work, so you can try the
CMD ftp -i -s:PUT.FTP
[This technique comes from fellow focal pointer Duncan. ]
July 11, 2005, 01:26 PM
<lnguyen>
Susannah,

I will give that a try thanks!
I will let you know how it comes out


Long
July 11, 2005, 03:24 PM
<lnguyen>
Susannah,

that worked great! much appreciated!
i have another question to this...
how could i add a check to this.. say if the connection failed the first time how could i get it to retry a few times and if it failed in the specified number of times... how could i get an error message by email?

thanks,

Long
July 11, 2005, 03:29 PM
susannah
hmmm. dunno.
If you were doing a GET, then you could check to see if the file came down:
CMD STATE D:\...\MYFILE.TXT
-RUN
-IF &RETCODE NE 0 ... then no file
I don't know how to check on the ftp site, unless you tried a GET against the given file name.
Someone else will come along and teach us both.
How are you faring with the hurricaine?
July 11, 2005, 03:36 PM
<lnguyen>
I am doing a put file. Basically, I want to try and reconnect repeatedly until it connects. Sometimes, I have problems connecting to this particular vendor.


We actually didnt see but 2 drops of rain here. It hardly touched us where we are. We are located in the northern part of louisiana

thanks again for all your help

Long