PDA

View Full Version : [CLOSED] 1.2.4 FileUploadField on IE and duplicate name



pepez
3 May 2009, 2:07 AM
The request is parsed using org.apache.commons.fileupload.servlet.ServletFileUpload parseRequest.

On IE 6 & IE 7 file upload request contains two fields with same name for FileUploadField. On FF3 or Safari the upload works fine and no duplicate elements are found in the request.

pepez
12 May 2009, 1:37 AM
Anyone else with the same problem? Or am I using file upload somehow in a wrong way? :-?

monzonj
12 May 2009, 1:58 AM
I don't have it, and I use the upload widget a lot. I use IE6 and I don't have any trouble so far.

If you don't put some source code so I can compare I can't tell you what's wrong. I use common-fileupload.jar in the server too.

pepez
20 May 2009, 6:21 AM
test case:




package ccc.contentcreator.client;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.FileUploadField;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.google.gwt.core.client.EntryPoint;


/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public final class ContentCreator implements EntryPoint {

private final FormPanel panel = new FormPanel();

public void onModuleLoad() {

Window w = new Window();
w.setWidth(640);
w.setHeight(480);
w.setLayout(new FitLayout());
w.setBodyStyle("backgroundColor: white;");
w.setMaximizable(true);
w.show();

panel.setAction("upload");
panel.setEncoding(FormPanel.Encoding.MULTIPART);
panel.setMethod(FormPanel.Method.POST);

TextField<String> description = new TextField<String>();
description.setName("description");
description.setFieldLabel("description");
panel.add(description);

FileUploadField file = new FileUploadField();
file.setName("fileField");
file.setFieldLabel("file");
panel.add(file);

panel.addButton(new Button(
"submit",
saveAction()));

w.add(panel);

}
private SelectionListener<ButtonEvent> saveAction() {
return new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(final ButtonEvent ce) {
panel.submit();
}
};
}
}

pepez
20 May 2009, 8:21 AM
Ah, nothing to do with GXT. Our file handling was not handling form properly.

Calling org.apache.commons.fileupload.FileItem.isFormField() helps... :">

lostistn
27 Oct 2009, 5:48 PM
The request is parsed using org.apache.commons.fileupload.servlet.ServletFileUpload parseRequest.

On IE 6 & IE 7 file upload request contains two fields with same name for FileUploadField. On FF3 or Safari the upload works fine and no duplicate elements are found in the request.

the same problem happens to me, does anyone know how to solve this?