Dear All,
Does anyone knows how to download a csv file from a webpage directory as a save as like when we want to download a file from a http server or ftp server? I got a sample coding but i don't think it's the solution as i displays only the data and does not download the file as a save as menu.
if (isset($_REQUEST["file"])) {
$file=$dir.$_REQUEST["file"];
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=".basename($file)."");
readfile("$file");
} else {
echo "No file selected";
Regards
Stéphane
Simply downloading a file from a webpage
Moderator: General Moderators
-
Dilbert137
- Forum Commoner
- Posts: 57
- Joined: Sat Jun 02, 2007 5:02 am
- Location: Mauritius