Anton Kasianchuk
Anton Kasianchuk

Reputation: 1217

com.google.gwt.user.client.ui.FileUpload how to set text?

I want to use this class com.google.gwt.user.client.ui.FileUpload for file uploading but I faced with the next issue. I cannot find how to set text programmatically. I mean in TextBox I have setText method to do it. How can I do it in FileUpload?

Upvotes: 0

Views: 684

Answers (1)

Suresh Atta
Suresh Atta

Reputation: 122026

You cannot set,Since GWT file upload wraps with html input type="file".So there is no way to set set filename or path (text) to that.

That should be select by user only,for sure.

You can only get from it.

If you are talking about setting some name to your control like "select file",take a lable and add.

http://en.wikipedia.org/wiki/JavaScript#Security

JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the web. Browser authors contain this risk using two restrictions. First, scripts run in a sandbox in which they can only perform web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one web site do not have access to information such as usernames, passwords, or cookies sent to another site

Upvotes: 2

Related Questions