*:FTPOPTION.PRG * Create a FTP Object if it does not exist lparameter cUserId,cPassword,cFtpAddr,cTheFile,cFtpFile,cFtpPath, tlSilentMode if vartype(m.sz_ftp)#'O' sz_ftp = newobject('ftp_service',"ftp.prg") endif *:adding message here also local lcReturn, lcSetSafety, s lcReturn=".T." * Try to get a handle into the Internet and Connect Briefly with the FTP Site * Note: Insert your USER ID, PASSWORD, FTP ADDRESS, PORT # Here * Note: ("21" is the Default Port) lcSetSafety = set('safety') set safety off if sz_ftp.OpenInternet(m.cUserId,m.cPassword, m.cFtpAddr, "21") * =strtofile("Successful Connection", "FTP_Messages.txt") * Copy up a file to the server *: putFtpFile("remote file name and path","local File name and path" *:Adding this code to position to ftp path specified in customer table if specified * Change to that directory if !empty(m.cFtpPath) *? "--- Changing Directory to FTP Directory " + cftppath *:Check if directory found if !sz_ftp.ChangeFtpDirectory(m.cFtpPath) s=sz_ftp.GetErrorCode(.t.) lcReturn=".F.Can not change directory" && Set to false if - Will use this as a check as to whether && files sending is in order. If false will drop through that code && and return the error endif endif *:Check to see if directory change (where applicable) generated an error. If so do not *:perform file transfer if m.lcReturn =".T." if !sz_ftp.PutFtpFile(m.cFtpFile, m.cTheFile) lcReturn=".F.Can not put file "+ m.cFtpFile+" on the FTP Site" else lcReturn = ".T." endif endif sz_ftp.CloseInternet() else if not m.tlSilentMode =messagebox("No Connection Made", 64, "FTP Message") endif sz_ftp.CloseInternet() lcReturn=".F.No Connection Made" endif *sz_ftp.release() release sz_ftp *:Adding message here also return m.lcReturn>I downloaded a Class called FTP Service Class (written by Robert Abraham) from this forum.