File: downloadimage.php

Recommend this page to a friend!
  Classes of Bharat Parmar  >  PHP Web Page Screenshot  >  downloadimage.php  >  Download  
File: downloadimage.php
Role: Auxiliary script
Content type: text/plain
Description: This file will ask user to download the generated image
Class: PHP Web Page Screenshot
Capture Web page screenshots using HTML2Canvas
Author: By
Last change:
Date: 4 years ago
Size: 501 bytes
 

Contents

Class file image Download
<?php
if(isset($_GET['file']) && $_GET['file']!="")
{
   
$file = "screenshot/".$_GET['file'];
    if (
file_exists($file)) {
       
header('Content-Description: File Transfer');
       
header('Content-Type: application/octet-stream');
       
header('Content-Disposition: attachment; filename="'.basename($file).'"');
       
header('Expires: 0');
       
header('Cache-Control: must-revalidate');
       
header('Pragma: public');
       
header('Content-Length: ' . filesize($file));
       
readfile($file);
        exit;
    }
}
?>


For more information send a message to info at phpclasses dot org.