'filename' problem... heeeelp! :)
From: larco (larco.SPAM377gHFDyg64dGFDGsuysffytENDSPAM_at_o2.pl)
Date: 11/29/03
- Next message: Kyle Mizell: "Re: Hosting Websites - Any Recomandations?"
- Previous message: Michael Fuhr: "Re: opening secure file"
- Next in thread: Jeff Weiss: "Re: 'filename' problem... heeeelp! :)"
- Reply: Jeff Weiss: "Re: 'filename' problem... heeeelp! :)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Nov 2003 04:18:10 +0100
Hi!
This script is for file download. But when the 'save' window pop-up, it
displays .... this script's name, not the file name...
Any ideas?
<?php
$filename = "hehehe.jpg";
$directory = "."; // for this example is set to current
$dl_full = $directory . "/" . $filename;
$dl_name = $filename;
if (!file_exists($dl_full))
{
echo"File <b>$dl_name</b> does not exist.";
exit();
}
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$dl_name");
header("Content-Length: ".filesize($dl_full));
header("Accept-Ranges: bytes");
header("Pragma: no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-transfer-encoding: binary");
@readfile($dl_full);
?>
Jarek.
- Next message: Kyle Mizell: "Re: Hosting Websites - Any Recomandations?"
- Previous message: Michael Fuhr: "Re: opening secure file"
- Next in thread: Jeff Weiss: "Re: 'filename' problem... heeeelp! :)"
- Reply: Jeff Weiss: "Re: 'filename' problem... heeeelp! :)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|