Change displayed file name to download

[email protected] (Php Developer)
Newsgroups php.general
Message-ID <[email protected]>
Hi,

I'm using the following code:
____________________
$fp      = fopen($filename, 'r+');
$content = fread($fp, 
filesize($filename));
fclose($fp);
header("Content-type: 
application/msword");
header("Content-Disposition: attachment; 
filename=$filename");
echo $content;
exit;
___________________

Now when downloading a file the default name that appears for the user is 
the realname of the file i the server with the real path the only 
difference is that the slashes are modified by underscore.

My 
question is: is there any way how to control the name that will be 
displayed for the customer? Or at least skip the path and display just 
the file's name?

Thank you


      __________________________________________________________________
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.