[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] using ftp from sqr



Tam,

This is an example to FTP from Windows to UNIX

create a file with contents like this:

open 123.456.789.12
ftpusr
4ftponly
ascii
append g:\PeopleSoft\mxiss_grw.txt /home/ftpusr/files/mxissuef_grw.txt
literal site chmod 777 /home/ftpusr/files/mxissuef_grw.txt
quit
EXIT


 (use put instead of append if you want to overwrite the file if it exists)

 this file could be created and written by your SQR program; assume that is
is
 and that $local_file = 'g:\PeopleSoft\mxiss_grw.txt'
 and that $ftp_file is the name of the above file
 
 close $ftp_file after writing it...

then in your SQR program, do this:

  let $syscmd = 'FTP -s:' || $ftp_file
  CALL SYSTEM USING $syscmd #stat WAIT
  if #stat = 0 
   let $disp = 'FTP successful...'
   display $disp

   let #stat1 = delete($local_file)
   if #stat1 <> 0
    let $disp = 'Error ' || to_char(#stat1) || ' deleting ' || $local_file
    display $disp
   end-if

  else
   let $disp = 'Error ' || to_char(#stat) || ' attempting FTP...'
   display $disp
  end-if
 end-if

Tom

> -----Original Message-----
> From: tam kag [SMTP:kaghdot@hotmail.com]
> Sent: Wednesday, January 26, 2005 7:08 PM
> To:   sqr-users@sqrug.org
> Subject:      [sqr-users] using ftp from sqr
> 
> Hello,
> 
> Im working on a project where i need to FTP a file to a unix box
> 
> this is the code that I have tried, any info well be helpfull
> 
> I'm FTPing to a unix box from a unix box
> 
> the code:
> call system using 'ftp -n unix_box' #stat
> call system using 'user userid userpassword' #stat
> call system using 'cd /dirone/dirtwo/dirthree' #stat
> call system using 'put hello.txt' #stat
> 
> 
> 
> Thank you
> 
> 
> 
> 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users