here is the commands:
Goga's Ftp Client
Version: 0.5 BETA
CDebugOn
This command will set the Debug ON by typing it in top of your code.
CDebugOff
This command will set the Debug OFF by typing it in top of your code.
CFtpUser UserName as string
you writing the username(login) of the ftp.
CFtpHost HostName as string
You writing the IP/Hostname of the ftp where you want to join.
CFtpSetPort PortNumber as Value
This command will set the port of the ftp where you want to connect to.
(by not typing it, the port will stay default: 21)
CFtpPass Password as string
You setting the password of the ftp where you want to join
CFtpConnect AnonymousFlag as boolean, TimeOut as dword
thats the command where you connecting to the ftp.
AnonymousFlag = if u want to connect as Anonymous, then you chosing: 1
TimeOut = this is the TimeOut of the ftp connection if milliseconds (if u want it as default, you typing 0)
CFtpChangeDir DirName as string
this command will set you the Dir in FTP.
DirName = this is the dir name that u want to Change.
CFtpConnected
By returning value 1, it will say that you are connected to the ftp.
by returning value 0, it will say that u are not connected to the ftp.
CFtpGetList
this command uses only once per folder. this command checks you all of the files that exists in the FTP.
CFtpBytesToKiloBytes(Bytes as dword)
this command convering bytes to KiloBytes.
CFtpFileQuantity
This command will return you a value of how many files are founded (using the command CFtpGetList) in the ftp.
CFtpClearListing
This command will clear you the CFtpGetList list.
CFtpGetFileName(FileNumber)
this command will return you a selected file number's Name.
CFtpGetFileTime(
FileNumber)
this command will return you a selected file number's creation time.
CFtpGetFileSize(
FileNumber)
this command will return you a selected file number's Size
CFtpGetFileMonth(
FileNumber)
this command will return you a selected file number's creation Month
.
CFtpGetFileFormat(
FileNumber)
this command will return you a selected file number's Format.
if the selected filenumber is Folder, then it will return you as string "Folder"
if the selected filenumber is File, it will return you as "File"
CFtpDownloadFile FtpFileName as string, LocalFileName as stringthis command will download you a file from ftp to your PC.
FtpFileName = you selecting the file name of the ftp.
LocalFileName = this command is selects where you want to download the file.
it also can return 1 if the download successes.
CFtpUploadFile LocalFileName as string, FtpFileName as string, Append as boolean
this command will upload you a file from PC to FTP.
LocalFileName = this command is selects the file that you want to upload to FTP.
FtpFileName = this is file name of the ftp that you whish to upload on.
Append = if append value is 1, then it will APPEND the ftp file with the new file, if the append value is 0, it will normaly delete the ftp file and put up the new file.
it also can return 1 if the upload successes.
CFtpFileExist FtpFileName as string
this command checks if file exist on FTP or not.
FtpFileName = File name that you whish to know if it exist.
it will return 0 if the file does not exist. it will return 1 if the file exist.
CFtpFolderExist FtpFolderName as string
this command checks if Folder exist on FTP or not.
FtpFolderName = Folder name that you whish to know if it exist.
it will return 0 if the Folder does not exist. it will return 1 if the file exist.
CFtpChangeDirUp
this command will change the dir one step UP.
CFtpDisconnect
this command will disconnect from FTP.
it will also return 1 if the change successes and 0 if he cant change dir up.
CFtpDeleteFile FileName as string
this command will delete you a selected file in FTP.
it also can return 1 if the deleting successes.
CFtpDeleteFolder FolderName as string
this command will delete you a selected file in FTP.
it also can return 1 if the deleting successes.
CFtpRename OreginalFileName as string, NewFileName as string
this command will rename you File/Folder
OreginalFileName = oreginal file/folder name that you want to be Renamed
NewFileName = New File/Folder name.
CFtpResumeSupported
this command is checks if File Resume is supported so you can RESUME the upload if something happened.
by returning 1, it will means that the resume is supported.
by returning 0, it will means that the resume is not available.
CFtpMakeFolder FolderName as string
this command will create you folder in FTP.
FolderName = Folder name that you whish to create.
Examples:
- Connect:
CDebugOn
CFTPHost "Host"
CFTPUser "FTPUser"
CFTPPass "Password"
success = CFtpConnect(0,0)
if success = 1 then print "Successed!" else print "Can't connect."
wait key
- Dir Check:
print "Getting File List..."
sync
CFtpGetList
totalfiles = CFtpFileQuantity()
print
for a = 1 to TotalFiles
print "FileName: "+CFtpGetFileName(a)
print "FileSize: "+str$(CFtpGetFileSize(a))+"("+str$(BytesToKiloBytes(CFtpGetFileSize(a)))+"KB)"
print "CreatedFile Time: "+CFtpGetFileTime(a)
print "CreatedFile Day: "+str$(CFtpGetFileDay(a))
print "CreatedFile Month: "+CFtpGetFileMonth(a)
print "Format: "+CFtpGetFileFormat(a)
next a
print
print "Total Files: "+str$(TotalFiles)
CFtpClearListing
wait key
sorry for my bad english. fix me if i misspelled somewhere.