This object supports the client side of the ftp protocol (RFC959) and implements an interface similar to the usual ftp command line client.
1 FTPClient
FTP Object can be created invoking a new Ax.net.FTP Constructor. Parameters expected are: hostname, port (optional), username and password.
Copy
<script> var sftpcon = new Ax.net.FtpClient('dbsrv4', 'informix','******'); </script>
Return | Method | Description |
---|---|---|
void | disconnect() | Disconnects from server |
boolean | exists(String name) | Returns true if file name exists |
void | cd(String name) | Changes working directory |
void | rm(String name) | Deletes file |
void | rmdir(String name) | Deletes empty directory |
ArrayList<String> | list(String pattern) | Returns an array of files or folder names. You can get only a subset of files applying a pattern. You can use * as a replacement for any number of characters. |
ArrayList<LsEntry> | listFiles(String pattern) | Return an array of LsEntry objects |
void | mkdir(String name) | Creates a new directory with name passed as parameter |
void | put(String name, Object data) | Sends the content of data and creates a new file remotely with this content. data can be a Blob, file, byte[], etc. |
String | pwd() | Returns the current working directory |
void | rename(String src, String dst) | Renames a file in server. |
byte[] | getBytes(String name) | gets content of remote file in server with name passed as parameter. |
Blob | getBlob(String name) | gets content of remote file and returns a Blob. Internal blob name are set from remote file name passed as parameter. |