Hi,
I want to force the browser to pop up the file download dialog box even the file is of known MIME type???
I have been trying out for some time ..but cud not get it...
Forcing file download
Moderator: General Moderators
-
psmshankar
- Forum Commoner
- Posts: 96
- Joined: Tue Aug 06, 2002 4:25 am
- Location: India
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Put the file into a zip file. Off the top of my head I can't think of another way of circumventing known MIME types.
Although this search:
http://www.google.co.uk/search?sourceid ... +MIME+type
did yield this:
http://support.microsoft.com/default.as ... us;q260519
Mac
Although this search:
http://www.google.co.uk/search?sourceid ... +MIME+type
did yield this:
http://support.microsoft.com/default.as ... us;q260519
Mac
-
psmshankar
- Forum Commoner
- Posts: 96
- Joined: Tue Aug 06, 2002 4:25 am
- Location: India
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
while mozilla slavishly obeys to the given mime-type and appends the appropriate filenamesuffix wether wanted or not (grrr) microsoft implemented (once in their history of development) some kind of auto-file-type-detection inspecting the stream data and assiduously ignoring the content-type setting (GRRR) - not always but far too often. It seems also that IE is a bit nitpicking when it comes to the order of the headers.
Code: Select all
header('Content-type: application/octet-stream');
header('Content-disposition: attachment; filename='.$filename);
readfile($path.'/'.$filename);