neni
neni

Reputation: 813

How to preset the value of p:fileUpload

I am using <p:fileUpload> component. Is it possible to preselect and show the selected file in field before the browse button?

I am using Mojarra 2.0.3, PrimeFaces 2.2 RC2, GlassFish 3.

Upvotes: 1

Views: 1281

Answers (1)

BalusC
BalusC

Reputation: 1108722

No, if this was possible, this would have been a huge security hole. You would then in theory be able to let the selected file point to C:/path/to/passwords.txt and then use JavaScript to submit the form and so silently get a file with sensitive data from the client without its permission.

See also:

Upvotes: 1

Related Questions