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

On 12 Jul 2004 at 17:27, Ian Hickson wrote:

Spec text: 

> > > 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).

(Snipped my suggestion - I'll just discuss the points I didn't 
understand in the first place..)

> I don't really understand the difference. Why is your text better?

I have a problem with the note in brackets. Don't you think it puts 
unusual mind-reading requirements on the UA to know why the user 
changes the MIME type the uploaded file should be labelled with? 

Another issue is that less technical users have no idea what a MIME 
type is or how to choose one. For experienced users I guess perhaps a 
UI like this could be an option (with a few more details about the 
file and the expected types):
http://www.hallvord.com/opera/pictures/screenshots/typemismatch.png

The type of a selected file not matching the "accept" types will 
probably be a problem in two situations (speaking from a file-
extensions-map-to-mime-type viewpoint as I'm not entirely sure how 
this happens on a Mac.):
1) User has chosen a wrong file type (say, someone has pasted an 
image into Word and tries to upload it when a JPEG is expected. Doing 
this makes perfect sense to any newbie.)
2) User has files with original extensions that the UA can not map to 
an expected MIME type.

The UA may want to handle a situation where a *known* but unwanted 
file type is being uploaded differently from a situation where an 
unknown file extension is uploaded. The former may be more likely to 
happen to newbies and the latter to power users who probably are 
familiar with MIME types anyway.. Are these assumptions valid? (And 
how do Mac-UAs choose MIME types anyway?...)

Anyway, I basically suggest removing or clarifying the note in 
brackets.

> Well, the field _is_ invalid, until the user corrects the MIME type, then
> it is valid. The UA must never submit the file with the wrong MIME type.

"wrong" as in "not matching the file extension" or "not matching the 
accept attribute"? If the former and if the MIME type is customized 
by the user it may quite likely be wrong and not describe the actual 
file? :-?

Sorry to be an irregular correspondent Ian.

-- 
HRMS

spacing is a ^$?"%&$, and so is timing

Received on Saturday, 17 July 2004 10:06:15 UTC