mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
added it_zip_shared_multiple_files_and_download_it, it_try_zip_non_shared_file_with_shared_multiple_files_and_download_it test
This commit is contained in:
@@ -92,11 +92,17 @@ class FileAccessController extends Controller
|
||||
*/
|
||||
public function get_zip($id)
|
||||
{
|
||||
$disk = Storage::disk('local');
|
||||
|
||||
$zip = Zip::whereId($id)
|
||||
->where('user_id', Auth::id())
|
||||
->firstOrFail();
|
||||
|
||||
$disk = Storage::disk('local');
|
||||
$zip
|
||||
->user
|
||||
->record_download(
|
||||
$disk->size("zip/$zip->basename")
|
||||
);
|
||||
|
||||
return $disk->download("zip/$zip->basename", $zip->basename, [
|
||||
"Content-Type" => 'application/zip',
|
||||
@@ -116,21 +122,26 @@ class FileAccessController extends Controller
|
||||
*/
|
||||
public function get_zip_public($id, $token)
|
||||
{
|
||||
$disk = Storage::disk('local');
|
||||
|
||||
$zip = Zip::where('id', $id)
|
||||
->where('shared_token', $token)
|
||||
->first();
|
||||
|
||||
$zip_path = 'zip/' . $zip->basename;
|
||||
$zip
|
||||
->user
|
||||
->record_download(
|
||||
$disk->size("zip/$zip->basename")
|
||||
);
|
||||
|
||||
$header = [
|
||||
"Content-Type" => 'application/zip',
|
||||
"Content-Length" => Storage::disk('local')->size($zip_path),
|
||||
"Accept-Ranges" => "bytes",
|
||||
"Content-Range" => "bytes 0-600/" . Storage::disk('local')->size($zip_path),
|
||||
"Content-Disposition" => "attachment; filename=" . $zip->basename,
|
||||
];
|
||||
|
||||
return Storage::disk('local')->download($zip_path, $zip->basename, $header);
|
||||
return $disk
|
||||
->download("zip/$zip->basename", $zip->basename, [
|
||||
"Content-Type" => 'application/zip',
|
||||
"Content-Length" => $disk->size("zip/$zip->basename"),
|
||||
"Accept-Ranges" => "bytes",
|
||||
"Content-Range" => "bytes 0-600/" . $disk->size("zip/$zip->basename"),
|
||||
"Content-Disposition" => "attachment; filename=" . $zip->basename,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user