Can someone help me out and tell me what is wrong with following code?
The .tar file being downloaded is only 14kb while the "files" folder contains a video of 800MB.
`<?php
include 'vendor/autoload.php';
// Create a new archive stream object (tar or zip depending on user agent)
$zip = \Barracuda\ArchiveStream\Archive::instance_by_useragent('example');
$directory = 'files';
$files = array_diff(scandir($directory), array('..', '.', '.DS_Store'));
foreach ($files as $file) {
$fileSize = filesize($directory."/".$file);
$filePath = $directory."/".$file;
$zip->init_file_stream_transfer($filePath, $fileSize);
$zip->stream_file_part($data);
$zip->complete_file_stream();
}
// Finish the zip stream
$zip->finish();
Can someone help me out and tell me what is wrong with following code? The .tar file being downloaded is only 14kb while the "files" folder contains a video of 800MB.
`<?php include 'vendor/autoload.php';
?>`