Skip to content

s1rc/zf2-tus-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zend Framework 2 Tus Server

Library for tus server (tus protocol 1.0)

Installation

use composer

Server Usage

/**
 * Zend Framework action for uploading files
 */
public function uploadAction() {
  // Create and configure server
  $debug = false;
  $server = new \ZfTusServer\Server('/path/to/save/file', 
                           $this->getRequest(),
                           $debug
  );

  // Run server
  $server->process(true);
}

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]

Author

Jaroslaw Wasilewski [email protected].

This library is based on library (https://github.com/leblanc-simon/php-tus) by Simon Leblanc [email protected].

License

MIT

About

Library for tus server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.5%
  • Shell 0.5%