Library for tus server
PHP Shell


Library for tus server (tus protocol 0.2.1)


use composer

Client Usage

$client = new PhpTus\Client();

// Upload 1024 bytes of your file

// Get the fingerprint to upload the remaining later
$fingerprint = $client->getFingerprint();

// New session
$client = new PhpTus\Client();
// Indicate the old fingerprint, to resume the upload

// Upload the next 2048 bytes of your file 
// (1024 bytes have been sent in the first request)

// Upload the remaining of your file

Server Usage

Require : redis-server (on Debian/Ubuntu, apt-get install redis-server)

// Create and configure server
$server = new \PhpTus\Server(__DIR__.'/path-to-save-file', 
                            array('prefix' => 'php-tus')

// Run server

If you are with an Apache server, add an .htaccess file to redirect all request in the php page (without that, your PATCH call failed), like :

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]


Simon Leblanc