PHP code example of geol / storage

1. Go to this page and download the library: Download geol/storage 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/ */

    

geol / storage example snippets


composer install
composer update



use Geol\File\StorageClient;

$bucket = $_POST['bucket'];
$stoken = $_POST['stoken'];
$folder = $_POST['folder'];
$fileData = $_FILES['file_data'];

// 서비스에서 사용할 로직
$url = Client::requestHost("https://example.com/");
$client = new StorageClient();
$client->setUrl($url);
$client->upload($bucket, $stoken, $folder, $fileData);



use Geol\File\StorageClient;

$stoken = $_POST['stoken'];
$fullPath = $_POST['path'];
$url = Client::requestHost("https://example.com/");
$client = new StorageClient();
$client->setUrl($url);
$client->deleteFullPath($stoken, $fullPath);



use Geol\File\StorageClient;

$bucket = $_POST['bucket'];
$stoken = $_POST['stoken'];
$localPath = $_POST['path'];
$url = Client::requestHost("https://example.com/");
$client = new StorageClient();
$client->setUrl($url);
$client->deleteLocalPath($bucket, $stoken, $localPath);