W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2004

[whatwg] Re: overriding MIME type in accept attribute?

From: Hallvord Reiar Michaelsen Steen <hallvors@online.no>
Date: Wed, 07 Jul 2004 18:30:11 +0200
Message-ID: <40EC4133.3949.1F2376F@localhost>
On 7 Jul 2004 at 15:10, Ian Hickson wrote:

> > [Upload anyway] [Cancel]"

> Disregard my previous reply on this thread. This is a much better
> suggestion than mine.

Agree. Perhaps I can suggest a rewrite of the paragraph I found 
confusing?

Original:

> The ERROR_TYPE_MISMATCH code is used to indicate that at least one of the
> selected files does not have a MIME type conforming to one of the MIME
> types listed as acceptable. UAs may allow the user to override the MIME
> type to be one of the allowable types if the file is originally
> incorrectly labeled (but should not allow users to override the type
> merely to let submission continue, as that would defeat the point of
> having a restriction in the first place).

I suggest something like:

File uploads are considered invalid if the selected file does not 
match the accept attribute. The ERROR_TYPE_MISMATCH code is used to 
indicate that at least one of the selected files does not have a MIME 
type conforming to one of the MIME types listed as acceptable. UAs 
may allow the user to select files that do not match the given MIME 
type for upload, but the UA should warn the user before submitting 
the form that the server expects a different file type and allow the 
user to interrupt the submission in order to select a different file.

(I'm not sure about the validity bit. Obviously it may be helpful if 
the :invalid pseudoclass matches a file upload with a file selected 
by mistake, but it sort of interferes with the normal form validation 
process as there is no other case we permit the UA to say "I think 
this field isn't valid but if you want I'll let you submit it 
anyway"!)
Received on Wednesday, 7 July 2004 09:30:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:35 UTC