PHP code example of izapbrasil / richfilemanager-php
1. Go to this page and download the library: Download izapbrasil/richfilemanager-php 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/ */
izapbrasil / richfilemanager-php example snippets
$app = new \RFM\Application();
// local filesystem storage
$local = new \RFM\Repository\Local\Storage();
$app->setStorage($local);
// AWS S3 storage instance
$s3 = new \RFM\Repository\S3\Storage();
$app->setStorage($s3);
// local filesystem API
$app->api = new RFM\Api\LocalApi();
session_start();
// supposed that user folder name is stored in "userfolder" session variable
$folderPath = "/filemanager/files/" . $_SESSION["userfolder"];
$app = new \RFM\Application();
$local = new \RFM\Repository\Local\Storage();
// set relative path to storage root folder
$local->setRoot($folderPath, true);
$app->setStorage($local);
// set application API
$app->api = new RFM\Api\LocalApi();
$app->run();
$s3 = new \RFM\Repository\S3\Storage();
$s3->setRoot('user_folder', true);