W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

Re: [FileAPI] File.mediaType

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 10 Nov 2009 17:58:58 +0100
To: "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "WebApps WG" <public-webapps@w3.org>
Message-ID: <op.u26uskhl64w2qv@annevk-t60>
On Tue, 10 Nov 2009 17:53:14 +0100, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 11/10/09 8:33 PM, Anne van Kesteren wrote:
>> This should be a bit more exact as to how the mediaType is returned. I
>> would prefer ASCII-lowercase. Returning "application/octet-stream"
>> rather than null also seems better if the type is not known. That way
>> you do not have to type check. Other parts of the platform also handle
>> "application/octet-stream" as unknown.
> That's not necessarily true.  Most simply, loading a url in a browser  
> doesn't treat application/octet-stream the same way it treats a missing  
> Content-Type header.

True, can you ever get this situation when reading a file from disk?

>> Also, maybe we should just call this type? File.type seems unambiguous
>> enough.
> It seems that many people think of "JPG" or "PNG" or "HTML" etc as the  
> "file type".  Witness all the dialog in various software that talk about  
> "PNG files" and such.

Sure, but there's also <style>.type, <script>.type, <link>.type, etc. I  
don't see a reason to be inconsistent with that.

Anne van Kesteren
Received on Tuesday, 10 November 2009 16:59:40 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:20 UTC