[plug] Uploaded file too small?

Andrew Furey Andrew.Furey at gmail.com
Wed Sep 29 17:37:40 WST 2004


Hi all,

This may be slightly offtopic, but all the machines involved are Linux
based, not that it should matter...

I'm building up a website with WebGUI (web-based CMS) and am at
present trying to upload a JPG image (with a standard CGI file upload
form). I've dumped a copy of the file at
http://users.terminus.net.au/~andrew/48.jpg - as you can see it's a
perfectly normal image, 4096 bytes large, md5sum
942dbcf4eeca72c9f6a56330ca17980c.

But when I click Submit, the file that eventually gets saved on the
server is only 4094 bytes, hence with a different md5sum. This happens
with either Konqueror or Mozilla (latest sarge versions of both).
Mozilla still seems to display it OK (as do a couple of others
apparently), but Konqueror doesn't (unsurprising, since the image is
actually corrupt).

I've used the same upload form on the site dozens of times, without
noticing any problem... Being binary files I can't use diff, but
viewing with less (and confirming with dd | md5sum), it's only the
last two bytes affected. They are 0xFF 0xD9, which have ASCII values
of y-with-two-dots and U-with-` - both of which appear numerous times
elsewhere in the file.

Anyone seen anything like this before? I'm stumped...

Andrew

-- 
Linux supports the notion of a command line or a shell for the same
reason that only children read books with only pictures in them.
Language, be it English or something else, is the only tool flexible
enough to accomplish a sufficiently broad range of tasks.
                          -- Bill Garrett



More information about the plug mailing list