ABFTPConnect (host AsString, port AsInt, login AsString, pwd AsString)
Connects with a ftp site host (String) : ftp site e.g. ftp.mywebsite.com port (Int) : connection port, usually 21 login (String): user login pwd (String) : user password Example: myFTP.ABFTPConnect("ftp.mywebsite.com", 21, "login", "password") If myFTP.ABFTPConnected = True Then Msgbox("Connected", "") Else Msgbox(myFTP.ABFTPLastError, "") EndIf
ABFTPConnected AsBoolean [read only]
returns if you are connected to the ftp Example: If myFTP.ABFTPConnected = True Then Msgbox("Connected", "") Else Msgbox(myFTP.ABFTPLastError, "") EndIf
Deletes a file from the ftp site targetFolder (String): folder on the ftp site starting and ending with / targetFile (String) : file name Example: myftp.ABFTPDeleteFile("/upload/","test.txt") If myftp.ABFTPLastError <> ""Then Msgbox(myftp.ABFTPLastError,"") Else Msgbox("file deleted!", "") EndIf
ABFTPDisconnect
Disconnects from the ftp Example: myftp.ABFTPDisconnect()
Downloads a file from the ftp to the device sourceFolder (String): folder on the ftp starting and ending with / sourceFile (String) : filename on the ftp targetFolder (String): folder on the device starting and ending with / targetFile (String) : filename on the device Example: sdRoot = File.DirRootExternal & "/" myftp.ABFTPDownload("/upload/", "test.txt", sdRoot, "test2.txt") If myftp.ABFTPLastError <> ""Then Msgbox(myftp.ABFTPLastError,"") Else Msgbox("File downloaded!, "") EndIf
ABFTPLastError AsString [read only]
returns the last error message if any Example: If myftp.ABFTPLastError <> ""Then Msgbox(myftp.ABFTPLastError,"") Else Msgbox("everything ok", "") EndIf
ABFTPListFiles (listFolder AsString) AsString()
Returns a table of strings with the file names listFolder (String): the folder to list Example: Dim myFiles() AsString myfiles = myftp.ABFTPListFiles("/upload/") If myftp.ABFTPLastError <> ""Then Msgbox(myftp.ABFTPLastError,"") Else For a = 0To myfiles.Length - 1 listview1.AddSingleLine(myfiles(a)) Next EndIf
Uploads a file from the device to the ftp sourceFolder (String): folder on the device starting and ending with / sourceFile (String) : filename on the device targetFolder (String): folder on the ftp starting and ending with / targetFile (String) : filename on the ftp Example: sdRoot = File.DirRootExternal & "/" myftp.ABFTPUpload(sdRoot, "test.txt","upload","test.txt") If myftp.ABFTPLastError <> ""Then Msgbox(myftp.ABFTPLastError,"") Else Msgbox("file uploaded!","") EndIf Top