jijo-paulose / gwtupload

Automatically exported from code.google.com/p/gwtupload
Other
0 stars 0 forks source link

File name with special chars not handled correctly #206

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Upload a file with special char (e.g. "filewith-é.txt")
2.On the server side file name is messed-up (e.g. "filewith-?.txt")

What version of the product are you using? On what operating system?
We use a tomcat and set it to use UTF-8
We use gwtupload 1.0.2-SNAPSHOT

I managed to fix this issue by changing Uploader.java code:
Add this line 
FormElement.as(uploadForm.getElement()).setAcceptCharset("UTF-8");

after:
...
public Uploader(FileInputType type, FormPanel form) {
    thisInstance = this;
    this.fileInputType = type;

    if (form == null) {
      form = new FormFlowPanel();
    }
    uploadForm = form;
    uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
    uploadForm.setMethod(FormPanel.METHOD_POST);
    uploadForm.setAction(servletPath);
    uploadForm.addSubmitHandler(onSubmitFormHandler);
    uploadForm.addSubmitCompleteHandler(onSubmitCompleteHandler);
    --------FormElement.as(uploadForm.getElement()).setAcceptCharset("UTF-8");------
...

Is there another way to fix this issue without changing the source code?
If not could you include this fix?
Thanks

Original issue reported on code.google.com by benjamin...@gmail.com on 5 Dec 2014 at 5:15

GoogleCodeExporter commented 8 years ago
Fixed not released.
Use 1.0.2-SNAPSHOT in the meanwhile I release 1.0.2

Thanks for reporting

Original comment by manuel.carrasco.m on 7 Jan 2015 at 3:27