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

Bug 417815

Summary: [Fileupload] special characters (ä,ö,ü etc.) in filename
Product: [RT] RAP Reporter: Stefan Milchram <stefan.milchram>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot showing corrupted file name none

Description Stefan Milchram CLA 2013-09-23 08:04:38 EDT
When uploading a file with special characters in the filename (like ä.txt) the filename is corrupted.
Look at method org.eclipse.rap.rwt.supplemental.fileupload.internal.FileUploadProcessor.readUploaddedFileItem(HttpServletRequest) when uploading such a file.
Comment 1 Ivan Furnadjiev CLA 2013-09-23 08:47:08 EDT
Stefan, we can't reproduce the filename corruption with all browsers. Can you give some hints what to look for in org.eclipse.rap.rwt.supplemental.fileupload.internal.FileUploadProcessor.readUploaddedFileItem(HttpServletRequest)?
Comment 2 Stefan Milchram CLA 2013-09-23 08:55:51 EDT
Created attachment 235715 [details]
Screenshot showing corrupted file name
Comment 3 Stefan Milchram CLA 2013-09-23 08:57:45 EDT
The screenshot shows that the corrupted filename comes from the apache-code. I googled for apache fileupload and character issues, but did not find a solution for this.
I used Chrome and IE to reproduce the error.
Comment 4 Ivan Furnadjiev CLA 2013-09-23 09:10:07 EDT
Could you check the request body when uploading a file? Is the filename corrupted in the request as well (filename inside Content-Disposition)?
Comment 5 Stefan Milchram CLA 2013-09-23 09:37:42 EDT
It is already corrupted there:

------WebKitFormBoundaryXHrWzMItZPiBBlZl
Content-Disposition: form-data; name="file"; filename="ä.txt"
Content-Type: text/plain


------WebKitFormBoundaryXHrWzMItZPiBBlZl--
Comment 6 Ivan Furnadjiev CLA 2013-09-23 11:15:01 EDT
This means it's not a RAP (Apache FileUpload) issue. If browser transmit the filename corrupted we can't do anything about it. Which OS are you using?
Comment 7 Stefan Milchram CLA 2013-09-23 11:21:59 EDT
Yes, sry i missed that.
We currently use Windows XP.
Comment 8 Ivan Furnadjiev CLA 2013-09-24 03:03:48 EDT
I will close it as NOT_ECLIPSE. Please reopen if you disagree.
Comment 9 Stefan Milchram CLA 2013-09-24 08:02:44 EDT
The problem seems to be caused by a missing charset=UTF-8 in the ContentType of the request to the servicehandler "org.eclipse.rap.fileupload".

Copy of the headers of the request:
"
POST /abs?servicehandler=org.eclipse.rap.fileupload&cid=713d0ed5&token=e9d2b2ec0c07cf HTTP/1.1
Host: 127.0.0.1:10080
Connection: keep-alive
Content-Length: 180
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Origin: http://127.0.0.1:10080
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryp5yCqqWAB6rTdDns
Referer: http://127.0.0.1:10080/abs
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,de;q=0.6
Cookie: JSESSIONID=gri268d0cedvicsfk47c3pqs; settingStore=1346400222265_0
"

When i set the encoding manually in org.eclipse.rap.rwt.supplemental.fileupload.internal.FileUploadProcessor.readUploadedFileItem(HttpServletRequest) before "upload.parseRequest( request );" it also works, but the charset should be specified in the request.
Comment 10 Ivan Furnadjiev CLA 2013-09-24 09:11:13 EDT
Stefan, I can't reproduce it on my virtual machine with Windows XP (SP3) - both with Firefox and IE8. The filename is not corrupted. Is the server running on the Windows XP machine or the client?
Comment 11 Stefan Milchram CLA 2013-09-24 09:41:22 EDT
I am running the server directly from eclipse using the rap-launcher. 
Browser and eclipse are running on Windows XP.