- download multiple files in public folder

- frontend build
This commit is contained in:
Peter Papp
2020-12-19 11:34:32 +01:00
parent b16f22b0eb
commit a10d394abb
16 changed files with 520 additions and 464 deletions

View File

@@ -122,6 +122,32 @@ class FileAccessController extends Controller
return Storage::download($zip_path, $zip->basename, $header);
}
/**
* Get generated zip for guest
*
* @param $id
* @param $token
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function get_zip_public($id, $token)
{
$zip = Zip::where('id', $id)
->where('shared_token', $token)
->first();
$zip_path = 'zip/' . $zip->basename;
$header = [
"Content-Type" => 'application/zip',
"Content-Length" => Storage::size($zip_path),
"Accept-Ranges" => "bytes",
"Content-Range" => "bytes 0-600/" . Storage::size($zip_path),
"Content-Disposition" => "attachment; filename=" . $zip->basename,
];
return Storage::download($zip_path, $zip->basename, $header);
}
/**
* Get file public
*