Avoid the actual path to appear
Posted: Mon Jul 31, 2006 12:21 am
Everah | Please use
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, when i want to view/download the file the actual path appears at the url , how can i avoid this.
below is the code that i'm usingCode: Select all
if (file_exists($file_path_csv)) {
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
{
header("Location: ".$file_path_csv);
}
else
{
$len = filesize($file_path_csv);
header("Content-Description: File Transfer");
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$list.'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$len);
readfile(''.$file_path_csv.'');
}
}Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]