Hi I have some appliacation written in GWT 2.2 (tested also on previuos versions) with file upload. Basicly there is FileUpload开发者_运维问答 component with Struts servlet on server side. The problem is that it works fine on IE and FF, but does not work on Chrome and Opera.
I found some tip to use gwtupload library ( i build the simplest case ) and the problem still occurs... With gwtupload I get alert with: "Error, your browser has not sent any information. Please try again or try it using another browser"
Simple code for gwtupload version:
defaultUploader = new SingleUploader();
verticalPanel.add(defaultUploader);
defaultUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
// Load the image in the document and in the case of success attach it to the viewer
private IUploader.OnFinishUploaderHandler onFinishUploaderHandler = new IUploader.OnFinishUploaderHandler() {
public void onFinish(IUploader uploader) {
if (uploader.getStatus() == IUploadStatus.Status.SUCCESS) {
//new PreloadedImage(uploader.fileUrl(), showImage);
// The server can send information to the client.
// You can parse this information using XML or JSON libraries
// Document doc = XMLParser.parse(uploader.getServerResponse());
// String size = IUploader.Utils.getXmlNodeValue(doc, "file-1-size");
// String type = IUploader.Utils.getXmlNodeValue(doc, "file-1-type");
Window.alert("Upload work");
}
}
};
Deafult servlet on the serves side.
Again, it works only on FF and IE. I hope somebody faced similar problem. :)
It could be some nasty WebKit bug. I think to remember something about a problem uploading files with WebKit-based browsers on OS X. You may want to check the WebKit bug database.
精彩评论