PHP code example of carry0987 / filetree

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

    

carry0987 / filetree example snippets




use carry0987\FileTree\FileTree;

// Initialize the keys and salt. Replace these values with your actual keys and salt.
$signatureKey = 'your_hex_signature_key';
$signatureSalt = 'your_hex_signature_salt';

// Create a new instance of PHP-FileTree.
$imageEncryptor = new FileTree($signatureKey, $signatureSalt);

// The URL of the folder you want to encrypt.
$originalPath = 'test/hello-world';

try {
    $signedUrl = $encryptor->generateEncryptedUrl($originalPath);
    echo 'http://127.0.0.1:3000' . $signedUrl;
} catch (Exception $e) {
    // handle exceptions
    echo "An error occurred: " . $e->getMessage();
}