Class: | FTP_SERVICE |
Description: | A character string array used to access the items in a ComboBox or ListBox control. Not available at design time; read/write at run time. |
Type | Character/Array |
By reference | |
Direction | Input |
Column | Description | Type |
laArray(x,1) | File Attributes | String |
laArray(x,2) | Links count | Number |
laArray(x,3) | Owner | String |
laArray(x,4) | Group | String |
laArray(x,5) | File Size | Number |
laArray(x,6) | File Last Write Time | DateTime |
laArray(x,7) | File Name | String |
Type | Character |
Direction | Input |
Type | Boolean |
Direction | Input |
Optional |
Value | Description |
_FTPS_RWF_File | luData is file name. |
_FTPS_RWF_String | luData is string. |
_FTPS_RWF_Array | luData is array. |
Type | Numeric |
Direction | Input |
Optional |
Value | Description |
FTP_TRANSFER_TYPE_ASCII | Transfers the file as ASCII. |
FTP_TRANSFER_TYPE_BINARY | Transfers the file as binary. |
LPARAMETERS OUTREF luData, INP lcMask,OPT_INP liFlags,OPT_INP lnFlag EXTERNAL ARRAY luData LOCAL liResult, lihFTP,lii,lcBuffer,lcData,liData,liEnd,liCount,llRet liFlags=IIF(PCOUNT()<3,_FTPS_RWF_File,m.liFlags) lnFlag=IIF(PCOUNT()<4,FTP_TRANSFER_TYPE_ASCII,m.lnFlag) IF This.OpenFTPConnection(This.cCurrentDir) && Open an FTP Handle IF BITTEST(m.liFlags,2) && Array? DIMENSION m.luData [1, 1] luData [1, 1] = .NULL. ENDIF lihFTP=0 This.BeforeList(@m.luData,@m.lcMask,m.liFlags,m.lnFlag) liResult=IIF(This._FTPCommand("LIST "+m.lcMask,FTP_TRANSFER_TYPE_ASCII,0,@m.lihFTP),1,0) IF m.liResult #0 && OK, FTP list is openned llRet=.T. lii=0 liData=500 STORE 1 TO fResult,liRead lcData="" DO WHILE m.liRead>0 liRead=0 lcBuffer=SPACE(m.liData) liResult = InternetReadFile(m.lihFTP, @m.lcBuffer, m.liData, @m.liRead) =This.GetExtendedError() This.AtList(@m.luData,@m.lcMask,m.liFlags,m.lnFlag,@m.lcBuffer,m.liResult) lcData=m.lcData+LEFT(m.lcBuffer,m.liRead) lii=m.lii+m.liRead ENDDO =InternetCloseHandle(m.lihFTP) =This.AfterList(m.luData,m.lcMask,m.liFlags,m.lnFlag,m.liResult) DO CASE CASE m.liResult=0 CASE !BITTEST(m.liFlags,0) AND !BITTEST(m.liFlags,2) && File? IF STRTOFILE(m.lcData,m.luData)=0 This.SetExtendedError(_FTPS_UE_CWF,"") llRet=.F. ENDIF CASE BITTEST(m.liFlags,0) && String? luData=m.lcData CASE BITTEST(m.liFlags,2) && Array? IF ISNULL(This.oLIstPE) This.oLIstPE=CREATEOBJECT("_LIST_PARSER_ENGINE") ENDIF This.oLIstPE.oFTP=This llRet=This.oLIstPE.Parse(@m.luData,@m.lcData) This.oLIstPE.oFTP=.NULL. ENDCASE ENDIF =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection()) && Close FTP Handle RETURN m.llRet ELSE =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection()) && Close FTP Handle RETURN .F. && Unable to get FTP Connection ENDIF