PHTML

Rashkae ubuntu at tigershaunt.com
Thu Sep 18 16:17:05 UTC 2008


Derek Broughton wrote:
> Markus Schönhaber wrote:
> 
>> Derek Broughton:
>>
>>> Markus Schönhaber wrote:
>>>> Nothing you do on your local machine will change the behaviour of the
>>>>> server for www.xplanner.org.
>>> Nothing?  I find that really hard to believe, though I admit I'm having
>>> some trouble myself...
>> I'm talking about the server's behaviour itself, not about circumventing
>> the effects this behaviour (like using a proxy that changes the
>> Content-Type header or whatever).
>> If you can come up with a generally applicable way how I, just by
>> fiddling around with my local machine, can manipulate other people's
>> servers, please tell me. I'd be very interested.
> 
> But you shouldn't need to manipulate anybody else's server - your browser
> should be capable of taking an "application/x-httpd-php" content type
> (or "useless/garbage") and handling it the same way it handles "text/html".

Eh, no, not at all.  this is the way IE generally works.  If there is a
file name in the URL, IE will use the extension to figure out the file
type and open with the appropriate application.

All other browsers, Firefox, Safari, (I don't know about Opera) always
trust the mime type header.  If it's "useless garbage" the stream gets
treated, for all intents and purposes, the same as "binary/application
octec-stream"  (paraphrasing from memory, so probably not exactly right)

This will cause some compatibility issues with misconfigured servers,
but otherwise is considered the 'right' way to go.

Usually, the problems are exactly opposite.  It's a great irony of the
Universe that Apache installs with mime 'magic' detection enabled by
default.  This will often cause files that are supposed to be binary to
be detected as text and Firefox always opens them in the browser.  The
only way around it is to right click the link to Save target, whereas MS
IE saves the file to disk the way it was intended to do.




More information about the ubuntu-users mailing list