PHP code example of modufolio / tus-psr7

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

    

modufolio / tus-psr7 example snippets


use Modufolio\Tus\TusServer;

$uploadDir = '/path/to/uploads';
$maxSize = 1024 * 1024 * 100; // 100MB
$chunkSize = 1024 * 1024 * 5; // 5MB

$server = new TusServer($uploadDir, $maxSize, $chunkSize);

// Handle the request
$response = $server->handle($request);