PHP code example of kfirba / directo
1. Go to this page and download the library: Download kfirba/directo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kfirba / directo example snippets
Kfirba\Directo\Support\DirectoServiceProvider::class,
// You can also change the options on-the-fly
Directo::setOptions(['acl' => 'private'])->inputsAsArray();
use Kfirba\Directo\Directo;
ket', 'region', 'key', 'secret', $options = []);
<form action=" echo $directo->formUrl()
// Facade:
Directo::formUrl();
Directo::inputsAsHtml();
// Type-hinted
// SomeController.php:
use Kfirba\Directo\Directo;
// ...
public function index(Directo $directo)
{
dd($directo->signature());
}
$directo->sign($policy);
// =>
// ['policy' => 'base64-encoded policy...', 'signature => 'the signature...']
$signature = new Signature($secret, $region, $policy);
$signature->sign($policy);
// =>
// ['policy' => 'base64-encoded policy...', 'signature => 'the signature...']
Directo::sign($policy);
// =>
// ['policy' => 'base64-encoded policy...', 'signature => 'the signature...']
$directo = new Directo("bucket", "region", "key", "secret", [
'acl' => 'private',
'max_file_size' => 10,
'additional_inputs' => [
'Content-Disposition' => 'attachment'
]
]);
'Directo' => Kfirba\Directo\Support\Facades\Directo::class,
bash
$ php artisan vendor:publish --tag=directo