Raise a "File Download" Dialog Box for the XML MIME Type under IE 5
| From: | Denis Bourdon | Date: | Sun, 30 Jul 2000 06:42:01 +0000 |
| Subject: | Raise a "File Download" Dialog Box for the XML MIME Type under IE 5 | ||
| Groups: | php.general php.windows | ||
| Request: | Send a blank email to php-general+get-9025@lists.php.net to get a copy of this message | ||
Hello!
I'd like to raise a "File Download" dialog box to download an XML document
created dynamically with PHP. So I put in this script:
header("Content-disposition: filename=file.xml");
header("Content-type: text/XML");
header("Pragma: no-cache");
header("Expires: 0");
Actually, it doesn't raise any dialog box under IE 5 and 5.5, whereas it
works under Netscape 4.7. Actually, as IE 5+ is an XML parser, XML is a
known MIME type for him, and so it browses the file.
So I try to declare it as an attachment to force the raise of the "File
Download" Dialog Box:
header("Content-disposition: attachment; filename=file.xml");
header("Content-type: text/XML");
header("Pragma: no-cache");
header("Expires: 0");
with 'attachment' in the Content-type: under IE it raises a dialog box but
it wants to download it as "myscript.php" instead of "file.xml", which is
quite strange because it does fit to the HTTP reference...
Then I try to change and even delete the Content-type but it didn't work
either.
As IE 5+ has an XML parser, I'd like this to work under IE.
Thanks for help!
Den.
PS: does someone know the accurate MIME-type for XML: is it "text/XML" or
"application/XML"? I found nothing in the REC-xml-19980210. Thanks!
--
Denis Bourdon - dbourdon@dbourdon.com
Etudiant à Telecom Grenoble ENSIMAG/ENSERG
site personnel: www.dbourdon.com
webmaster de l'espace étudiants de Telecom Grenoble:
www-telecoms.imag.fr/etudiants