PHP Classes

File: download.php

Recommend this page to a friend!
  Classes of Bharat Parmar   PHP MySQL Database Export to SQL   download.php   Download  
File: download.php
Role: Auxiliary script
Content type: text/plain
Description: Download the Exported Database File Script
Class: PHP MySQL Database Export to SQL
Dump a MySQL database records to a SQL file
Author: By
Last change: file uploaded
Date: 7 years ago
Size: 428 bytes
 

Contents

Class file image Download
<?php
$file
= 'dbexport.sql';

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;
}
?>