Lescasse Consulting
 Home    Company    News    Prices    Download    Buy    Forums   
Read Me
Buy
Forums
Resume
AntiSpam 1.2
wBackup 1.11
NetAccess 2.0
Visual APL 1.0 
APL+Win 7.3 
APL+Win Products 
APL+Win Objects™ 
APL+Win Training 
APL+Web Services
APL+Web Component 
APL+ History
Dyalog.Net Tutorial
Conferences 
Powerpoint
White Papers
Web Hosting
References
Links
 
APL+Win Objects™ 6.0

TADO5
TADO5 Tutorial
TAPLDraw5
TAPLEdit5
TAPLSession5
TAbale5
TAboutBox5
TAccess5
TAgent5
TBlatMail5
TButton5
TCDO5
TCRC5
TCancelButton5
TCheck5
TCheckGroup5
TChildForm5
TChooseColor5
TChooseFont5
TClipBoard5
TClock5
TCodeStats5
TColors5
TCombo5
TComboDrive5
TComboFilter5
TComboList5
TComboTree5
TCommandBar5
TCommandButton5
TControlClass5
TCueCard5
TDHTML5
TDHTMLEditor5
TDateTime5
TDateTimeFr5
TDates5
TDemoHandlers5
TDisplay5
TDOS5
TDualSelect5
TEdit5
TEditAmount5
TEditDir5
TEditEnter5
TEditFile5
TEditGrid5
TEditList5
TEditListview5
TEditMenu5
TEditNum5
TEditSelect5
TEditSpin5
TEmail5
TError5
TExampleForm5
TExcel5
TExcel5 Tutorial
TFindReplace5
TFOne5
TFTP5
TFTP5 Tutorial
TFileCompare5
TFileMenu5
TFileMenuDef5
TFlatButton5
TForm5
TFormClass5
TFormEditor5
TFrame5
TGetDir5
TGif5
TGifForm5
TGifWb5
TGoMenu5
TGraphX5
TGrid5
TGridDisplay5
TGridPrint5
TGUID5
THLine5
THTML5
THTML5 Tutorial
THTTP5
THelp5
THelpMenu5
TImagelist5
TInfo5
TIniFile5
TInstall5
TInternet5
TJpg5
TJpgWb5
TLabel5
TList5
TListview5
TLock5
TLogs5
TMAPI5
TMath5
TMDIForm5
TMSOutlook5
TMaskEdit5
TMedia5
TMenu5
TMessage5
TModalCall5
TMsgBox5
TNavigator5
TNetwork5
TNonVisualClass5
TODBC5
TOKButton5
TObject5
TOpenFile5
TOption5
TOptionGroup5
TOutlook5
TOutlookMail5
TOWCSpread5
TPDF5
TPFKeys5
TPage5
TPassword5
TPicture5
TPing5
TPopupMenu5
TPowerpoint5
TPowerpoint5 Tutorial
TPrinter5
TProgress5
TProgressDlg5
TQuestion5
TRegistry5
TRegistryKey5
TResource5
TRichEdit5
TSPX5
TSQLDMO5
TScheduler5
TScroll5
TSelector5
TSpinner5
TSplitter5
TStatus5
TStopWatch5
TTest5
TTestError5
TTextFile5
TTimer5
TTip5
TTipForm5
TTLI5
TToolBar5
TToolbox5
TToolsMenu5
TTrackbar5
TTranslate5
TTree5
TVLine5
TViewMenu5
TWebBrowser5
TWebServer5
TWebSite5
TWebSiteNet5
TWinMenu5
TWord5
TYesNo5
    Visits:  3755 (39 on line) Last Update: Dec 21, 2003  
    TFTP5    Printer Friendly  
 
Description   Inheritance   Example   Properties   Methods
 
 Description

The non visual TFTP5 Object uses the ChilkatFTP free ActiveX control to do FTP work with a remote computer
With TFTP5 you can upload and download files under program control, but also list directories, erase files,
create directories, change directories, etc...  on the remote computer, provided you have FTP access to
this computer.

This object is particularly useful for programmatically updating a Web Site.

The ChilkatFTP ActiveX control (ChildkatFTP.dll) is installed with APL+Win Objectsâ„¢ 6.0 and can otherwise
be downloaded from: http://www.chilkatsoft.com

Description   Inheritance   Example   Properties   Methods
 
 Inheritance

Inherits from:  TObject5

Description   Inheritance   Example   Properties   Methods
 
 Example
 

      'ftp'Å’wi'*Create' 'TFTP5'
      'ftp'Œwi'ConnectMe'                        © if you have defined a CMDCONNECTME User Command (see method ConnectMe)
1

      'ftp'Œwi'isconnected'                      © check that we are connected
1

      'ftp'Œwi'Dir' '*.htm'                      © display all .htm file in root dir
 APL+Win Grid.htm   209019 20021122      0 
 APLWin40Syntax.htm  64090 20011207      0 
 Essai Tableau1.htm 114655 20030421 160400 
 LcLogo.htm            233 20020215      0 

      'ftp'Œwi'Download' 'APLWin40Syntax.htm' 'c:\temp\APLWin40Syntax.htm'  © download one of them to the local PC
1

      'ftp'Œwi'ChDir'                            © show the current remote dir
/

      'ftp'Œwi'ChDir' 'download/apl2000'         © change to another remote dir
1

      'ftp'Œwi'Dir'                              © display the files it contains
 apl2000.ttf    41380 20031220 161700 
 aplfont.zip    50174 19980129      0 
 Aplfont2.zip   18619 20020208      0 
 apllinux.zip  636833 20011123      0 
 Aplplus.ttf    57124 20011207      0 
 aplplus.zip    31946 20000123      0 
 aplplusi.ttf   82324 19980129      0 
 aplw2002.zip  654144 19980129      0 
 aplw3015.exe 1698213 19990216      0 
 aplw3015.rtp  478943 19990216      0 
 aplw3015.zip 1629805 20021122      0 
 aplw3503.exe 1734235 19991125      0 
 aplw3503.zip 1666809 20021122      0 
 apx20ocx.zip   60782 19981017      0 
 dllutil.zip    10600 19980129      0 
 GridDoc.zip   138737 20020911      0 
 guihlp.zip    273094 19980129      0 
 hold5.zip      12240 19980129      0 
 read3015.txt   11487 19990216      0 
 read3503.rtf   10322 19991125      0 
 registry.zip   17949 19980129      0 

      'ftp'Œwi'ChDir' '../..'                    © return 2 dirs in the hierarchy
1

      'ftp'Œwi'MkDir' 'TestFTP5'                 © create a new remote directory
      'ftp'Œwi'Dir' '*.'                         © display all remote directories
 _vti_cnf\             0 0 0 
 _vti_pvt\             0 0 0 
 APL+Win Grid_files\   0 0 0 
 APLWin40Syntax_files\ 0 0 0 
 AspForum\             0 0 0 
 aspnet_client\        0 0 0 
 Databases\            0 0 0 
 Download\             0 0 0 
 Files\                0 0 0 
 Images\               0 0 0 
 Members\              0 0 0 
 New\                  0 0 0 
 Objects\              0 0 0 
 Photos\               0 0 0 
 Styles\               0 0 0 
 TestFTP5\             0 0 0 
 wBackup\              0 0 0 
 WebTrends\            0 0 0 

      'ftp'Œwi'ChDir' 'TestFTP5'                 © change to TestFTP5 remote subdir
1

      'ftp'Œwi'ChDir'                            © prove it
/TestFTP5

      'ftp'Œwi'Upload' 'c:\temp\*.htm' '/TestFTP5'  © upload all htm files from c:\temp to TestFTP5 remote subdir
7

      'ftp'Œwi'Dir' '/TestFTP5'                  © show which files we got
 APLWin40Syntax.htm 64090 20021221 232900 
 Leroux.htm          6347 20021221 232900 
 pierre.htm          4049 20021221 232900 
 renault.htm        20221 20021221 232900 
 test.htm              71 20021221 232900 
 test1.htm           4276 20031221      0 
 TestScriptX.htm      956 20031221      0 

      'ftp'Œwi'Ren' '/TestFTP5/test.htm' '/TestFTP5/test2.htm'  © rename one of the remote files
1

      'ftp'Œwi'Dir' '/TestFTP5'                  © prove it
 APLWin40Syntax.htm 64090 20021221 232900 
 Leroux.htm          6347 20021221 232900 
 pierre.htm          4049 20021221 232900 
 renault.htm        20221 20021221 232900 
 test1.htm           4276 20031221      0 
 test2.htm             71 20021221 232900 
 TestScriptX.htm      956 20031221      0 

      'ftp'Œwi'XmlDir'                           © return an XML list of files in remote dir

  
    APLWin40Syntax.htm
    64090
    
  
  
    Leroux.htm
    6347
    
  
  
    pierre.htm
    4049
    
  
  
    renault.htm
    20221
    
  
  
    test1.htm
    4276
    
  
  
    test2.htm
    71
    
  
  
    TestScriptX.htm
    956
    
  



      'ftp'Œwi'Del' '/TestFTP5/*.htm'            © remove all .htm files from remote dir
7

      'ftp'Œwi'XmlLog'                           © show FTP log so far



    7
    100010
    C:\Temp\APLWin40Syntax.htm
    C:\Temp\Leroux.htm
    C:\Temp\pierre.htm
    C:\Temp\renault.htm
    C:\Temp\test.htm
    C:\Temp\test1.htm
    C:\Temp\TestScriptX.htm
    8


    *.htm
    7
    APLWin40Syntax.htm
    Leroux.htm
    pierre.htm
    renault.htm
    test1.htm
    test2.htm
    TestScriptX.htm
    0






      'ftp'Œwi'RmDir' '/TestFTP5'                © remove now empty TestFTP5 remote dir
 
Description   Inheritance   Example   Properties   Methods
 
 Properties
 
class    
Description:  Return current object class 
Syntax:  class„'obj' Œwi 'class' 
help    
Example: 
0 0½'ftp' Œwi '*Create' 'TFTP5' 
'ftp' Œwi 'ConnectMe'                        © if you have defined a CMDCONNECTME User Command (see method ConnectMe) 
© or: 
© 'ftp' Œwi 'Connect' 'username' 'password' 'www.lescasse.com'21  © replace all arguments by your own settings 
'ftp' Œwi 'isconnected'                      © check that we are connected 
'ftp' Œwi 'Dir' '*.htm'                      © display all .htm file in root dir 
'ftp' Œwi 'Download' 'APLWin40Syntax.htm' 'c:\temp\APLWin40Syntax.htm'  © download one of them to the local PC 
'ftp' Œwi 'ChDir'                            © show the current remote dir 
'ftp' Œwi 'ChDir' 'download/apl2000'         © change to another remote dir 
'ftp' Œwi 'Dir'                              © display the files it contains 
'ftp' Œwi 'ChDir' '../..'                    © return 2 dirs in the hierarchy 
'ftp' Œwi 'MkDir' 'TestFTP5'                 © create a new remote directory 
'ftp' Œwi 'Dir' '*.'                         © display all remote directories 
'ftp' Œwi 'ChDir' 'TestFTP5'                 © change to TestFTP5 remote subdir 
'ftp' Œwi 'ChDir'                            © prove it 
'ftp' Œwi 'Upload' 'c:\temp\*.htm' '/TestFTP5'  © upload all htm files from c:\temp to TestFTP5 remote subdir 
'ftp' Œwi 'Dir' '/TestFTP5'                  © show which files we got 
'ftp' Œwi 'Ren' '/TestFTP5/test.htm' '/TestFTP5/test2.htm'  © rename one of the remote files 
'ftp' Œwi 'Dir' '/TestFTP5'                  © prove it 
'ftp' Œwi 'XmlDir'                           © return an XML list of files in remote dir 
'ftp' Œwi 'Del' '/TestFTP5/*.htm'            © remove all .htm files from remote dir 
'ftp' Œwi 'XmlLog'                           © show FTP log so far 
'ftp' Œwi 'RmDir' '/TestFTP5'                © remove now empty TestFTP5 remote dir 
isconnected    
Description:  Returns 1 if currently connected and logged into FTP server, 0 otherwise (read-only property) 
Syntax:  'obj' Å’wi 'isconnected' 
Examples: 
      'ftp' Å’wi 'isconnected' 
1 
version    
Description:  Returns the TFTPobject version number (read-only) property 
Syntax:  'obj' Å’wi 'version' 
Examples: 
      'ftp' Å’wi 'version' 
1.4.0 
Description   Inheritance   Example   Properties   Methods
 
 Methods
 
ChDir    
Description:  Return current remote directory content 
Syntax 1:  dir„'obj' Œwi 'ChDir'              © report current directory 
Syntax 2:  rc„'obj' Œwi 'ChDir'relativepath   © changes current remote directory 
relativepath:  a relative path name (starting from current directory) 
rc:  return code is 1=success or 0=failure 
Example: 
      'ftp' Å’wi 'ChDir' '/ftproot/ftp' 
Connect    
Description:  Connects to an FTP Server 
Syntax:  'obj' Å’wi 'Connect'UserName Password HostName {Port} 
UserName:  a valid FTP user name 
Password:  the FTP user password 
HostName:  the domain name on the FTP Server 
Port:  the FTP port (defaults to 21) 
Example: 
      'ftp' Å’wi 'Connect' 'username' 'password' 'www.lescasse.com' 
or: 
      'ftp' Å’wi 'Connect' 'username' 'password' 'www.lescasse.com'21 
ConnectMe    
Description:  This method runs the ]connectme User Command if available 
Syntax:  rc„'obj' Œwi 'ConnectMe' 
rc:  return code (1=connection succeeded, 0=connection failed) 
Note:  this method is used to connect you to your preferred FTP site 
You must have defined a CMDCONNECTME function or User Command defined 
according to the following model: 
    ’ CMDCONNECTME A 
[1]   Œwi '*xUserName' 'username'       © example: 'lescasse' 
[2]   Œwi '*xPassword' 'password'       © example: 'mypassword' 
[3]   Å’wi '*xPort'21 
[4]   Œwi '*xHostname' 'domain_name'    © example: 'www.lescasse.com' 
    ’ 
Saving the CMDCONNECTME in your UCMD file allows you to show your 
workspace code without exposing your FTP UserName and Password. 
Do not forget the *'s in the above example. 
*:R„1ª…0}" 
Del    
Description:  Delete one or more remote files 
Syntax:  rc„'obj' Œwi 'Del'relativefile 
relativefile:  a remote file with a relative path name (starting from current directory) 
rc:  number of files deleted or ¯1 if failure 
Note: wildcards characters(* and ?) may be used to erase more than one file at a time 
Examples: 
      'ftp' Å’wi 'ChDir' '/ftproot/ftp' 
      'ftp' Å’wi 'Del' 'temp/picutil.w3' 
      'ftp' Å’wi 'Del' 'temp/wback*.*' 
Dir    
Description:  Return current remote directory content 
Syntax:  dir„'obj' Œwi 'Dir' {pattern} 
pattern:  a relative path (may use pattern with * and ? wildcards) 
If you omit <pattern> all files in directory are returned 
dir:  [;1] „… file name or directory\ 
      [;2] „… file size in bytes 
      [;3] „… file date 
      [;4] „… file time 
Example: Assuming my FTP account points to C:\INETPUB on my server: 
     'ftp' Å’wi 'Dir' 
AdminScripts\ 0 0 0 
catalog.wci\  0 0 0 
ftproot\      0 0 0 
iissamples\   0 0 0 
mailroot\     0 0 0 
scripts\      0 0 0 
wwwroot\      0 0 0 
     'ftp' Å’wi 'Dir' 'wwwroot/lc/*.htm' 
APL+Win Grid.htm   209019 20021122 0 
APLWin40Syntax.htm  64090 20011207 0 
LcLogo.htm            233 20020215 0 
Note that directory information is returned as 0's.  File times 
may also be returned as 0's.  Directories are reported with a 
trailing \. 
Disconnect    
Description:  Close the current FTP connection 
Syntax:  'obj' Å’wi 'Close' 
Example: 
     'ftp' Å’wi 'Close' 
Download    
Description:  Downloads one or more files from a remote directory 
Syntax 1:  rc„'obj' Œwi 'Download'remotefile localfile 
Syntax 2:  rc„'obj' Œwi 'Download'remotepattern localdir 
remotefile:  a remote file name with a relative path 
localfile:  a complete local file name 
remotepattern:  a remote file path with * and/or ? wildcard characters 
          (if no * or ?, syntax 1 is assumed) 
localdir:  a local directory 
rc:  number of downloaded files if success or ¯1 if failure 
Example: 
      'ftp' Å’wi '*Create' 'TFTP5' 
      'ftp' Å’wi 'ConnectMe' 
1 © success 
      'ftp' Å’wi 'ChDir' 
/ © at root directory at start 
      'ftp' Å’wi 'ChDir' '/ftproot/ftp/temp' 
      'ftp' Å’wi 'Download'  'picutil.w3' 'c:\temp\picutil.w3' 
1  © 1 file downloaded 
      'ftp' Å’wi 'Download' '/ftproot/ftp/temp/*.*' 'c:\temp\download' 
5  © 5 files downloaded 
MkDir    
Description:  Create a new remote directory 
Syntax:  'obj' Å’wi 'MkDir'relativepath 
relativepath:  a relative path name (starting from current directory) 
Example: 
      'ftp' Å’wi 'MkDir' '/ftproot/ftp/test' 
New     Description: Create a new instance of TFTP5
Example:
      'obj' Å’wi '*Create' 'TFTP5'

Ren    
Description:  Renames a remote file 
Syntax:  'obj' Å’wi 'Ren'oldfilename newfilename 
oldfilename:  a relative or absolute file name of the file to rename 
newfilename:  the new relative or absolute file name 
Examples: 
      'ftp' Å’wi 'Chdir' '/ftproot/ftp' 
      'ftp' Å’wi 'Ren' '/ftproot/ftp/temp/picutil.w3' 'temp/picut.w3 
RmDir    
Description:  Remove a remote directory 
Syntax:  'obj' Å’wi 'RmDir'relativepath 
relativepath:  a relative path name (starting from current directory) 
Examples: 
      'ftp' Å’wi 'ChDir' '/ftproot/ftp/mai' 
      'ftp' Å’wi 'ChDir' 
ftproot/ftp/mai 
      'ftp' Å’wi 'MkDir' 'temp' 
      'ftp' Å’wi 'RmDir' 'temp' 
      'ftp' Å’wi 'MkDir' 'temp' 
      'ftp' Å’wi 'RmDir' '/ftproot/ftp/temp' 
Upload    
Description:  Sends one or more files to a remote directory 
Syntax 1:  rc„'obj' Œwi 'UpLoad'localfile remotefile   © for a single file upload 
Syntax 2:  rc„'obj' Œwi 'UpLoad'localpattern remotedir © for multiple files upload 
localfile:  a complete local file name 
remotefile:  a remote file name with a relative path 
localpattern:  a local file path with * and/or ? wildcard characters 
          (if no * or ?, syntax 1 is assumed) 
remotedir:  a relative remote directory 
rc:  number of uploaded files if success, or 0 or ¯1 if failure 
Example: 
      'ftp' Å’wi '*Create' 'TFTP5' 
      'ftp' Å’wi 'ConnectMe' 
1  © success 
      'ftp' Å’wi 'ChDir' 
/  © at root directory at start 
      'ftp' Å’wi 'UpLoad' 'c:\temp\picutil.w3' '/ftproot/ftp/temp/picutil.w3' 
      'ftp' Å’wi 'Upload' 'c:\temp\zipocx\*.*' '/ftproot/ftp/temp' 
5  © 5 files were uploaded 
      'ftp' Å’wi 'Upload' 'c:\temp\zipocx\*.*' '/ftproot/ftp/tmp' 
¯1 © failed to upload files because directory c:\inetpub\ftproot\ftp\tmp does not exist 
XmlDir    
Description:  Return XML representation of current remote directory content 
Syntax:  xmldir„'obj' Œwi 'XmlDir' 
Example: 
      'ftp' Å’wi 'XmlDir' 
XmlLog    
Description:  Return XML Log 
Syntax:  xmllog„'obj' Œwi 'XmlLog' 
xmllog:  an xml text representing all TFTP5 activity (including errors) 
Example: 
      'ftp' Å’wi 'XmlLog' 
Description   Inheritance   Example   Properties   Methods
 
 This entire Web site has been dynamically generated by APL+Win Objects™ 6.0
 For all questions contact:  info@lescasse.com
 Copyright © 2003-2005 Lescasse Consulting. All rights reserved.