Gotipath Storage is a file storage library for PHP. It provides one interface to interact with FTP/SFTP. When you use this package, you're protected from vendor lock-in, That mean you can connect to any FTP/SFTP storage. Also it's comes with base URL option to connect Gotipath CDN.
This package can be used as a framework-agnostic package. Follow these steps to get started:
You can install the package via composer:
composer require gotipath/storage
require_once __DIR__ . '/vendor/autoload.php';
$storage = new Storage('sftp', [
'host' => 'ftp.fas.xyx.com',
'username' => 'sftp/ftp username',
'password' => 'sftp/ftp password',
//if you connecting ssh
// 'privateKey' => '/path/to/privateKey',
// 'password' => 'encryption-password',
'port' => 22,
'root' => '/pub',
'timeout' => 30,
],$baseUrl='https://cdn.gotipath.com');
$path = 'uploads/testdir';
$config = []; // optional
$storage->makeDirectory($path, $config);
$storage->get($path);
$inputFile = $_FILES['file'];
$path = 'uploads/'.$inputFile['name'];
$temp = $_FILES["file"]["tmp_name"];
$storage->upload($path,$temp);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.