https://github.com/joseluisq/myftp
A PHP small class for FTP handling.
https://github.com/joseluisq/myftp
ftp ftp-handling php
Last synced: 23 days ago
JSON representation
A PHP small class for FTP handling.
- Host: GitHub
- URL: https://github.com/joseluisq/myftp
- Owner: joseluisq
- License: mit
- Created: 2015-05-25T17:13:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-01T23:38:02.000Z (almost 9 years ago)
- Last Synced: 2024-04-13T20:50:41.058Z (about 1 year ago)
- Topics: ftp, ftp-handling, php
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# MyFTP
> A PHP small class for FTP handling.
## Usage
```php
$ftp_settings array(
'hostname' => 'ftp.remote-server.com',
'username' => 'john',
'password' => '123456',
// 'port' => 21,
// 'passive' => TRUE
);// Initializing
$ftp = new MyFTP($ftp_settings);
$is_connected = $ftp->connect();// Upload file
$filepath_local = 'local_dir/local_file.zip';
$filepath_remote = 'remote_dir/remote_file.zip';// Checks if it connected and logged
if ($is_connected) {
// Upload file
$ftp->upload($filepath_local, $filepath_remote);
$ftp->close();
} else {
die("Couldn't connect to FTP Server");
}
```## Licence
MIT licence© 2016 [José Luis Quintana](http://quintana.io)