user3328186
user3328186

Reputation: 89

Vaadin : How to set default path for fileupload component?

Can I set default upload path to my vaadin fileupload component ? I would like to set some upload path to my vaadin component. If somebody does not choose to upload any files , my specific file would be uploaded. Can it be possible ?

For instance : I would like to do as

 upload.setDefaultFilePath("C:/ax/w.pdf");

Upvotes: 0

Views: 1267

Answers (1)

Raffaele
Raffaele

Reputation: 20885

This is a limit of the underlying technology, not of Vaadin itself. Browsers don't allow downloaded code to manipulate the content of an input file field, otherwise a malicious site could create a hidden one and silently stole data from the user.

So I don't think you'll ever find a way with Vaadin, either. However, if you target only one browser (or a limited set of) you can try to exercise the browser API itself in a custom extension, if any API exists in the target browser for doing this, and if selecting the file is really such a pain.

Upvotes: 3

Related Questions