Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-20
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andre Schild
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

[fileupload] Using getSize on DistFileItem after write returns 0 size

Created: 31/Mar/06 06:23 AM   Updated: 09/Mar/07 08:31 PM
Return to search
Component/s: None
Affects Version/s: 1.1 Final
Fix Version/s: 1.2

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: All

Bugzilla Id: 39160


 Description  « Hide
Steps to reproduce:

1. Upload a large file to a DiskFileItem so it is stored on the temporary location
2. Call getSize() to retrieve the uploaded file size
3. Call write('newlocation') to rename/write the file to the final destination
4. Call getSize()

In the 4. getSize() call, 0 is returned.

This is because the getSize() call looks for the no longer existing temporary file.

We must either make sure that the write() method updates the current file
location so getSize() can retrieve it from there,
or getSize is initialized on creation of the fileitem.

This bug is also present in the 1.2RC1



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.