Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 289708

Summary: [upload] UploadEvent#getUploadedTotal() returns higher value than the real file size
Product: [RT] RAP Reporter: Aleksandar Pavlov <a.pavlov>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: stefan.roeck
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Aleksandar Pavlov CLA 2009-09-17 05:39:07 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Build Identifier: I20090611-1540

Javadoc for UploadEvent#getUploadedTotal() sais: "@return The total file size."

That is not true. The value is always higher than the real file size. Additionally it returns value, that changes in two consequent uploads. 
Maybe it is indeed the total number of bites uploaded, but not the file size.

Reproducible: Always

Steps to Reproduce:
1. run uploadDemo
2. upload any file
3. compare the console logs "## total: 605" with the actual file size
4. the difference is between file name string length and up to 200B.



examplary logs:

file size: 1263577

## total: 1263785
filename     : bridge.war
stream       : java.io.FileInputStream@133f6dd
file saved
## partial: 1263789
## total: 1263789
100%
## total: 1263789
filename     : bridge.war
stream       : java.io.FileInputStream@1fb7565
file saved
Comment 1 Ralf Sternberg CLA 2011-09-27 06:29:13 EDT
The old upload widget is not supported anymore.
Please use the new FileUpload widget or the new FileDialog implementation.
See also this blog post: http://eclipsesource.com/blogs/2011/06/23/uploading-files-with-rap-14/