[UPHPU] I hate MSIE!
C. Ed Felt
ed at thefelts.net
Thu Sep 14 17:18:48 MDT 2006
Fellow PHP developers:
I have an annoying little issue with CSV files, mime types and IE and I
was wondering if any of you have suggestions.
There is nothing secret here so here is the PHP code I am using to pull
a CSV page from a buffer ($_SESSION["csv"]) to a browser. This code
works fine in Mozilla (of course) but is broken in MSIE (as usual):
The url is (not available to you of course):
http://panel_test.localhost/csvout.php
<?php
session_start();
header('Content-Type: application/txt');
$CSV = $_SESSION["csv"];
$name = $_SESSION["fileName"];
header('Content-Length: '.strlen($CSV));
header('Content-disposition: inline; filename="'.$name.'"');
echo $CSV;
?>
There are two scenarios here, the only constant is that my client is
Windows XP.
1. From Apache 2.0.50 (Win 32) I get:
* Mozilla:
"You have chosen to open
<filename>.csv
...
Open With Microsoft Office Excel (default)
..."
I can then open the file just fine in Excel.
* MSIE (6):
"File Download
...
Getting File Information:
csvout from panel_test.localhost
...
...
...
File Download - Security Warning
Do you want to save this file?
Name: csvout
Type: Unknown File Type
From: panl_test.localhost
...
While files from the Internet can be useful, this file type
can potentially harm your computer. If you do not trust the
source, do not
save this software. ...
"
I then get a blank file called "csvout" that I can save
(which is of course useless).
2. From Apache/2.0.54 (Fedora) Server I get:
* Mozilla:
"You have chosen to open
<filename>.csv
...
Open With Microsoft Office Excel (default)
..."
I can then open the file just fine in Excel.
* MSIE (6):
"File Download
Do you want to open or save this file?
Name: <filename>.csv
Type: Microsoft Excel Worksheet, 12.9 KB
From: <server>
....
"
I can then either save or directly open the file in Excel
just fine.
I am at my wits end on this one. I was just wondering if any of you
have any ideas. Unfortunately I am working in a Windows only shop, so I
have to get this to work with the WIN32 version of Apache and MSIE (6),
(the only case that doesn't work).
What I have tried so far:
http://www.dpawson.co.uk/xsl/sect4/spreadsheet.html
http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html
http://www.microsoft.com/technet/security/Bulletin/MS01-058.mspx
http://support.microsoft.com/kb/q279667/
http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.asp
http://joseph.randomnetworks.com/archives/2004/10/01/making-ie-accept-file-downloads
http://www.thescripts.com/forum/thread2624.html
Thanks in advance for any help/suggestions.
--
*Thank You,*
*C. Ed Felt*
(801) 766-8433 (home)
(801) 420-8879 (cell)
ed at thefelts.net <mailto:ed at thefelts.net>
*chat: *edeefelt(aim), edeefelt (yahoo), edeefelt at hotmail.com (msn)
http://www.thefelts.net <http://www.thefelts.net/>
More information about the UPHPU
mailing list