Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 17th, 2003, 06:39 PM
gennyblake gennyblake is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 63 gennyblake User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 16 m 52 sec
Reputation Power: 7
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)

Reply With Quote
  #2  
Old July 17th, 2003, 08:06 PM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
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.

Reply With Quote
  #3  
Old July 17th, 2003, 11:23 PM
Stink Sleeve's Avatar
Stink Sleeve Stink Sleeve is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2003
Location: New Hampshire, USA
Posts: 550 Stink Sleeve User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 17 m 26 sec
Reputation Power: 6
Compressing the file seems to be the cleanest route. Something
that most browsers should know how to handle.
__________________
Download Mozilla Firefox Now!

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDev Shed Lounge > download file prompt


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway