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

Hallvord Reiar Michaelsen Steen hallvors at online.no
Wed Jul 7 09:30:11 PDT 2004


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"!)



More information about the whatwg mailing list