21 lines
514 B
PHP
21 lines
514 B
PHP
<?php
|
|
|
|
$zipPath = "storage/documents/zip_files/";
|
|
@mkdir($zipPath, 0777, true);
|
|
|
|
if(getisset("path")){
|
|
$pdfDirectory = get("path");
|
|
}
|
|
|
|
$zipName = str_replace("storage/documents/", "", $pdfDirectory);
|
|
$zipName = str_replace("/", "", $zipName);
|
|
|
|
$zip_file = "$zipPath/$zipName.zip";
|
|
$command = "zip -r -j '$zip_file' '$pdfDirectory' ";
|
|
dump($command);
|
|
echo shell_exec($command);
|
|
|
|
//shell_exec("rm -r '$pdfDirectory' ")
|
|
?>
|
|
<a href="{{url($zip_file)}}" class="btn btn-primary">{{e2("Download PDF Zip File")}}</a>
|