[Clipart] uploader problems

Jonadab the Unsightly One jonadab at bright.net
Tue Aug 10 05:17:46 PDT 2004


Nicu Buculei <nicu at apsro.com> writes:

> i believe this file was damaged by the uploader, i can't open it in
> Inkscape: http://openclipart.org/incoming//red_flower_03.svg (unless i
> clean it before in a text editor)

Indeed.  I can't tell for sure, but this looks like it could
potentially represent a bug in CGI::Lite or else the file could have
been corrupted before it was uploaded.  Or it could be a bug in the
way the client's browser handles file upload, but that seems the least
likely of the three.

Given that the file included many carriage returns, but not at the end
of every line, just some lines, it seems most likely that the file was
already corrupted before upload.  But it's hard to be sure, and that
thing at the end did look like a separator, such as the kind used in
MIME and also in CGI file uploads.  Hmmmm...  We should watch for
this, to see if it happens repeatedly.

> the uploader has accepted this file as SVG, but the file is PNG with
> .svg extension: http://openclipart.org/incoming//red_flower_02.svg

Currently, the uploader does not make any attempt to second-guess what
filetype the user says a file is; it just takes the user's word for
it.  Also, until recently, SVG was the default.  I anticipated this
problem and have changed it so that the default is to not specify the
filetype, in which case the upload script complains and makes you
specify a filetype.  So it's harder to just forget that now.  However,
it's still easy enough to pick the wrong one -- or to pick the
filetype for the file you _intended_ to upload and then grab the wrong
one for the upload.  

What to do about this is an open question.  I don't want to be
rejecting files that don't have the right extension, because Mac users
will be trying to submit extensionless images (which may have periods
in the filenames -- somefile.v04 for the fourth version of an SVG
maybe), and I think we should allow that, if they tell us what
filetype it is so we can add the correct extension at upload time.
Also, there are alternate extensions, such as .xml for SVG images,
various extensions for zipfiles, and so on.  However, it might be
possible to detect mismatches, when the extension on the file is one
we recognize as belonging to a different filetype...

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/




More information about the clipart mailing list