Skip to content

Commit

Permalink
Show uploading from stream and from a file
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Sep 26, 2021
1 parent 3144da7 commit a5977f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FTP protocol support for the XP Framework ChangeLog

## ?.?.? / ????-??-??

## 10.2.0 / 2021-09-26

* Merged PR #10: Replace `FtpListIterator` with yield, deprecating the
class while doing so
(@thekid)
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ use io\File;

$c= (new FtpConnection('ftp://user:[email protected]/'))->connect();

// Upload index.txt to the connection's root directory
$c->rootDir()->file('index.txt')->uploadFrom(new File('index.txt'), FtpTransfer::ASCII);
// Upload logo.png to the connection's root directory
$c->rootDir()->file('logo.png')->uploadFrom(new File('logo.png'));

// Upload from a stream using ASCII mode
$c->rootDir()->file('README.md')->uploadFrom(
new MemoryInputStream('Read me first!'),
FtpTransfer::ASCII
);

$c->close();
```
Expand Down

0 comments on commit a5977f9

Please sign in to comment.