Skip to content

Commit

Permalink
initial file
Browse files Browse the repository at this point in the history
  • Loading branch information
luxzg authored May 14, 2020
1 parent cf9da85 commit b726f41
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sig2svg.download.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
// companion file to sig2svg.php ; from : https://www.tutorialrepublic.com/php-tutorial/php-file-download.php
$filepath = "/var/www/website/storage/".$_GET["filename"].".pdf";
// Process download
if(file_exists($filepath)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($filepath));
flush(); // Flush system output buffer
readfile($filepath);
die();
}
else {echo "Failed to find file";}
?>

0 comments on commit b726f41

Please sign in to comment.