gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 377 forks source link

FormData is missing overloading append methods (Blob/File) #8018

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 8021

Found in GWT Release:
GWT 2.4.0, 2.5.0

Detailed description (please be as specific as possible):

According to the W3C standard FormData is supposed to have 2 append functions (http://www.w3.org/TR/2010/WD-XMLHttpRequest2-20100907/#the-formdata-interface):

interface FormData {
  void append(DOMString name, Blob value);
  void append(DOMString name, DOMString value);
};

Currently in elemental the interface looks like this:

public interface FormData {
    void append(java.lang.String s, java.lang.String s1, java.lang.String s2);
}

Therefore it is not possible to upload files using the FormData object.

Workaround if you have one:

Extends JsFormData class and add missing append method:

public class ExtJsFormData extends JsFormData {
  protected ExtJsFormData() {}

  public final native void append(String name,Blob file,String filename) /*-{
     this.append(name,file,filename);
  }-*/;
}

Links to relevant GWT Developer Forum posts:

Link to patch posted at http://gwt-code-reviews.appspot.com:

Reported by uemit.seren on 2013-02-16 11:41:29

dankurka commented 9 years ago
Do you mind posting a patch, see: http://www.gwtproject.org/makinggwtbetter.html

Reported by dankurka@google.com on 2013-05-27 20:02:53

dankurka commented 9 years ago
I don't mind to submit a patch however AFAIK the GWT code in the Elemental library is
autogenerated from Webkit's IDL files. So I am not sure how to proceed here best ?
Re-run it and then submit the changes ? 

Reported by uemit.seren on 2013-05-29 12:27:52

dankurka commented 9 years ago
I'm struggling with this too and elemental related issues. Will be this fixed in future
GWT versions? (as all the elemental issues are old..)

Reported by vasco@byclosure.com on 2014-08-21 18:29:21