[Netsurf-develop] Local file types

John-Mark Bell jmb202 at ecs.soton.ac.uk
Sat Mar 25 00:58:36 GMT 2006


On Fri, 24 Mar 2006, Richard Porter wrote:

> NetSurf seems to be very particular about seeing particular file
> types. It will ignore a local css file if it's a text file - it must
> be css. But if the same text file is uploaded to the server it's no
> problem. It's a Linux server so it doesn't change the file type
> because it's got .css on the end - if I download it it's still a text
> file.

You're being incredibly vague; are you seriously suggesting that a web 
server isn't sending files whose name ends in .css with a text/css 
mimetype? Certainly Apache has this set up in its default configuration.

As for what happens under RISC OS, it's quite simple - the mimetype of a 
file is looked up by asking the MimeMap module[1] to convert between 
filetype and mimetype _unless_ the file is typed as text and has a file 
extension, in which case, the file extension is used for the mapping. In 
practice, this means:

Filename:       Filetype:       Computed Mimetype:

style           Text            text/plain
style/css       Text            text/css
style           CSS             text/css
style/css       CSS             text/css

You appear to be complaining about the first case, but there's no simple 
way to tell what the file in question contains (other than textual data)
so it gets the logical mimetype - text/plain. I believe this behaviour to 
be correct, consistent and logical.

> If I copy some text out of an html file and paste it into a form,
> NetSurf interprets the text as a new page and wipes out the form. I
> can't think of any situation in which I would want to load a page by
> pasting the source into the browser window. Drag and drop would be
> quite different.

That's one for Adrian to answer.

> Why is NS being so needlessly awkward?

I don't believe it is.


John.

1. NetSurf has an internal mapping table for core types which it checks
    first, in order to avoid issues when the user's MimeMap file doesn't
    contain all the needed mappings. This does not affect the behaviour in
    any way whatsoever.




More information about the netsurf-users mailing list