Re: Annoying brackets in IE temporary filenames - looking for a magic fix...
| From: | Curt Zirzow | Date: | Tue, 04 May 2004 05:09:59 +0000 |
| Subject: | Re: Annoying brackets in IE temporary filenames - looking for a magic fix... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185275@lists.php.net to get a copy of this message | ||
* Thus wrote gvarosky@conversent.com (gvarosky@conversent.com):
> Is anyone aware of a way via headers, or just plain voodoo, that will make a
> temporary file that IE uses not use the square brackets? i.e. foo[1].xls
Try telling IE not to cache the file:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
the file[1].ext usually happens when a file from with the same name
occurs in the cache.
>
> Here is my scenario:
>
> I have files being served out of a database from blob fields for an internal
> site. We seem to have this one picky program that does not like files served
> this way, and complains. If I visit my local IE cache directory, and remove
> the square brackets from the filename, I can open it just fine. If I put
> them back, I can no longer open the file. We need our users for convenience
> to be able to open these in the browser directly, instead of downloading the
> file, then browsing it it's location, and then opening it.
Now if you send this:
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=filename.xls");
IE is going to do one of the following:
- prompt the user what to do.
- open it with a plugin and display it directly in the browser
- open excel with the filename.
- do something else ;)
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."