Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#575 closed defect (fixed)

Spot image generator creates file with invalid size in database

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: BASE 2.3.1
Component: core Version:
Keywords: Cc:

Description

The file containing the zipped spot images is written correctly to disk, but the size registered in the database is not same as the actual size on disk. For example, the TestSpotImages program generates a zip-file of 96 846 bytes, but the entry in the database says 96548 bytes. This creates a problem if the zip file is downloaded since the end of it is not transmitted and it can't be opened by another program. Usually it complains about the file not being a valid zip file or it is missing an "end-of-central-directory signature".

See also mail by Chad Matsalla: http://sourceforge.net/mailarchive/message.php?msg_id=C24EA58C.9D6%25chad.matsalla%40nrc.ca

Change History (6)

comment:1 by Nicklas Nordborg, 17 years ago

Priority: minorcritical

The problem is in the File class. The File.UploadStream incorrectly tries to override the write(int) method with a write(byte) method. This means that some bytes written to the file are not counted and the file size is too low. Note that the bug doesn't affect the file contents written to the disk.

Updating to critical since the bug may be used to bypass the quota system.

comment:2 by Nicklas Nordborg, 17 years ago

Milestone: BASE 2.4BASE 2.3.1

comment:3 by Nicklas Nordborg, 17 years ago

Resolution: fixed
Status: newclosed

(In [3436]) Fixes #575: Spot image generator creates file with invalid size in database

comment:4 by Nicklas Nordborg, 17 years ago

Resolution: fixed
Status: closedreopened

Reopens this ticket because we must also fix the incorrect file size that may have made it into the database.

comment:5 by Nicklas Nordborg, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [3444]) Fixes #575. Additional fix is needed in the trunk. See #628

comment:6 by Nicklas Nordborg, 17 years ago

(In [3710]) Fixes #745: NullPointerException in File.getSize() References #628 and #575.

Note: See TracTickets for help on using tickets.