in reply to Sending MIME type headers not forcing desired behaviour.

Thanks all.

The ".htm" is only in the extension of the file being read. The filename being sent is set to ".ppt".

Adding in the '.' in the content-type header had no effect.

Removing the "<html>" tags from the html file had no effect.

The IE links are excellent, and contradictory. I'd like to cling to:

Mimesniffing doesn't mean that there is no way for a server to control how a file is handled. <Content-disposition: attachment; filename="filename.ext"> header enables a server to do precisely that. With this however, IE makes sure that the user gets prompted with the file type information (based on the extension specified by the server here) before the file is opened/saved.

but the current experience is proving that hope false.

Forget that fear of gravity,
Get a little savagery in your life.

  • Comment on Re: Sneding MIME type headers not forcing desired behaviour.

Replies are listed 'Best First'.
Re^2: Sending MIME type headers not forcing desired behaviour.
by brian_d_foy (Abbot) on Apr 06, 2005 at 00:11 UTC

    You might also have luck by trying to fake things out with PATH_INFO. We're straying off-topic here, but here goes: start with the URL you have right now:

    http://www.example.com/foo/powerpoint.html

    Tack on the end more stuff. The browser won't know which part of the path is the file name and which part is the PATH_INFO, although the server figures it out when it does its path walk.

    http://www.example.com/foo/powerpoint.html/no_really_i_mean _it.ppt

    If the browser gets to the point where it's going to decide the type based on the URL (or choose a file name to save it as), then this sometimes works. That trick is especially handy when a script returns the content, but you don't want the script name as the file name.

    http://www.example.com/cgi-bin/make_ppt.cgi/no_really_i_mean _it.ppt

    The trick is to use a lot of techniques all at the same time.

    Another piece of advice you didn't ask for: even though you are targetting IE, you might consider developing with a browser like Firefox. When you do that, you have a better chance of figuring out if its the server or the browser that's wrong. You still develop with IE, but the other browser is a check: if the server is wrong, it should (should!) be wrong in both browsers.

    I really don't miss my days as a web developer, when we had to support WebTV too. :)

    Good luck :)

    --
    brian d foy <brian@stonehenge.com>