Skip to content

tar compress gzip, bzip2 file and http stream download

License

Notifications You must be signed in to change notification settings

crucifyer/phptar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php tar compress gzip, bzip2 file and http stream download

$ php composer.phar require "crucifyer/phptar" "dev-main"
$xtar = new \Xeno\Compress\Tar();
$xtar->addFile('../dir/file.jpg');
$xtar->addFile('file.html', 'public_html/index.html');
$xtar->addFile('../dir/file.js', 'public_html/script.js');
$xtar->addString('string contents', 'string.txt');

// file
$xtar->save('test.tar.bz2');

// stream
$xtar->stream('test.tar.bz2'); // browser realtime compress download
exit;

// unicode filename stream
// url /down/load/example.php/1234/한국어파일명.tar.bz2
// $_SERVER["PATH_INFO"] is /1234/한국어파일명.tar.bz2 
$xtar->stream(null, \Xeno\Compress\Tar::BZ);

About

tar compress gzip, bzip2 file and http stream download

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages