开发者

GWT Alternate Button to FileUpload

Im writing some java code and im hitting a wall, with FileUpload, i am trying to get a alternate button to activate the filebrowser from the FileUpload.

I tried to dispatch the event from one to another, tried to extend FileUpload to have a button that triggers some action but no luck.

Fileupload upload = new FileUpload(); Button b = new Button("Browse",new Cli开发者_运维技巧ckHandler() { // trigger upload Browser });

Something like this.


You cannot do this due to security restrictions. The restriction is that untrusted code cannot trigger the File Browse dialog to open because it could then do so without user input, possibly tricking the user into thinking the dialog is from a different webapp or entirely different application.


Actually it is possible on IE6 and maybe IE7, all other prohibit this action. Read my question and answer: gwt fileupload

You might give a shot to SWFUpload in combination with swfupload-gwt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜