|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
download file prompt
I'm not sure which forum this falls into - so I'm asking it here.
I have a filetype I want people who vsit my website to be able to download. Its extension is .mxp (MasterCook for any cooking buffs out there). Technically it's a txt file with a formatted recipe in it. However, I'd like when someone clicks on a link to it for it to prompt them to download it to their harddrive. I thnk this can be done with the apache filetype configs in .htaccess right? I just need some help figuring out what to put in there. When I try to view a .mxp file it appears as text in my browser. I want it to prompt me to save it. Ideas? thanks Genny (typos are the fault of my martini) |
|
#2
|
||||
|
||||
|
It goes in the Apache forum.... you can ask a mod to move it for you.
Martini? Ick.. I don't know whether to be disgusted by or have respect for people who can drink Vodka. LOL Anyway, it's the mime.types file that controls how things are treated. I generally suggest to people who want to try and force a download prompt that they use the 'application/octet-stream' because it basically tells the browser: "I'm a stream of bytes - I'll tell you nothing more, you fool!". Of course, stupid browsers that are too dumb to use headers right (*cough*IE*cough*) won't necessarily honor that and may try to do their own thing with the file... for all you know, it could wind up opening the text file in media player or something. Compounding the problem, you have no way of knowing how the USER set up the browser to handle these things... for all you know, they could have set up their local MIME types to do any manner of illogical things. At any rate, you shouldn't be editing the mime.types file anyway - go take a look at the "AddType" directive in the Apache manual. Short answer: no way you can guarantee a download prompt, but you can make a pretty good effort. Last edited by Ctb : July 17th, 2003 at 08:14 PM. |
|
#3
|
||||
|
||||
|
Compressing the file seems to be the cleanest route. Something
that most browsers should know how to handle. |
![]() |
| Viewing: Dev Shed Forums > Other > Dev Shed Lounge > download file prompt |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|