Friday, February 24, 2012

Force download csv file using php

 <a href="download.php">Download sample "CSV" file</a>

download.php
<?php
ob_start();
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=example.csv");
readfile('example.csv');
ob_end_flush();
?>

No comments:

Post a Comment

Thank you for your Comment....

Popular Posts