[Clipart] Problems with the website during/after submission
ocalocal at btinternet.com
Thu Jan 6 07:47:50 PST 2005
Jonadab the Unsightly One wrote:
> Jon Phillips <jon at rejon.org> writes:
> > Why does the script need to check the filetype. It seems that this
> > should automatically be checked for, right?
> I'm not at all sure it's technically possible to guess right 100% of
> the time. I don't know enough about all of the file formats we
> support to know if there is reliable identification magic for all of
> them and, if so, that it is.
It would be enough for now just to look at the filename and deduce
the filetype from that - not 100% reliable, but probably more reliable
than the current method of hoping that the user specifies it correctly.
Later it would be possible to add code to inspect the file itself, but
this isn't essential for now.
A quick web search suggests that the way to get the filename is to parse
it out of the Content-Disposition header field, described in RFC 2183.
More information about the clipart