-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
159f125
commit 749fabd
Showing
3 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## 0.1.0 | ||
|
||
- Initial version | ||
- Connect to an FTP Server with Authorization | ||
- Get current directory | ||
- Change directory | ||
- Make directory | ||
- Delete directory | ||
- Upload file (in binary mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:ftpclient/ftpclient.dart'; | ||
|
||
void main() { | ||
|
||
// Create Connection | ||
FTPClient ftpClient = new FTPClient('example.com', user: 'myname', pass: 'mypass'); | ||
|
||
// Connect to FTP Server | ||
ftpClient.connect(); | ||
|
||
try { | ||
// Create Directory | ||
ftpClient.makeDirectory('test'); | ||
|
||
// Change Directory | ||
ftpClient.changeDirectory('test'); | ||
|
||
// Get current Directory | ||
print(ftpClient.currentDirectory()); | ||
|
||
// Upload File | ||
ftpClient.uploadFile(new File('test.zip')); | ||
|
||
// Navigate back | ||
ftpClient.changeDirectory('..'); | ||
|
||
// Delete Directory | ||
ftpClient.deleteDirectory('test'); | ||
} finally { | ||
// Disconnect | ||
ftpClient.disconnect(); | ||
} | ||
} |