commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@gmail.com>
Subject Re: [fileupload] jsp mime type
Date Wed, 22 Dec 2004 05:25:08 GMT
On Tue, 21 Dec 2004 21:11:54 -0800, Dakota Jack <dakota.jack@gmail.com> wrote:
> File types, of which there are thousands (see infra), have protocols,
> of course, which can be checked to determine whether they are real,
> fakes, ill constructed, etc.  If you check the list archives you will
> see some references to work at Harvard and other places on this.  You
> can always check the file as it is being uploaded, and there are other
> more sophisticated but rather obvious options.

I'd sort of agree with you about protocols if you replaced "file
types" with "content types" (or, more formally, MIME types).  The fact
that a file has a name with a particular extension is interesting, but
doesn't actually say anything about the *real* content in that file. 
It's only the fact that certain operating systems made that
association that the world became used to that idea.  (For the correct
approach, take a look at how the "file" command works on any Unix-ish
variant ... it looks for byte patterns in the *content* of the file
and ignores the name.)

At any rate, it's sort of irrelevant to discuss here, because Commons
FileUpload doesn't have any control over the content type that is set
by the client.  And it's not really the job of the upload software to
say "I know more than you know" and magically replace the content type
provided by the client with something else.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message