Re: Filename problem with file downloading

From: Date: Sun, 25 May 2003 23:55:02 +0000
Subject: Re: Filename problem with file downloading
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148938@lists.php.net to get a copy of this message
You'd have to show us the code which establishes the value of $filename, rather than the header() code. Justin on 26/05/03 10:24 AM, Alex Shi (chpshi@eol.ca) wrote: > Hello, > > Several days ago I posted question asking about how to handle file > downloading file in php. Thanks for those who answered me with their > help I learned a lot about it. But still I have problem with filename. The > file downloading code is like following: > > <?php > > // ...... > header ("Content-type: application/octet-stream"); > header ("Content-Disposition: attachment; filename=" . $filename); > header ("Pragma: no-cache"); > > readfile ($filename); > > // ..... > ?> > > Everything is ok except the $filename. I want the name to be created > in this format: FileName.[record#].[seqence#]. Say, FileName.64.023. > > The problem is, no matter how I create the value for $filename, the > filename generated at the local end on downloading will always like > this: FileName[1].64.023. The "[1]" is automatically added and I don't > understand why it was added there. > > Maybe this is not a php problem but I have no clue where can find the > answer and solution to fix it. This looks a tiny issue but a big headaque > to me. Please give me a hand if any one out there happen to know this. > Many thanks in advance! > > Alex Shi > > > >

« previous php.general (#148938) next »