How to preset the value of p:fileUpload

前端 未结 1 476
青春惊慌失措
青春惊慌失措 2020-12-22 00:56

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

I am using Mojarra

相关标签:
1条回答
  • 2020-12-22 01:34

    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:

    • How to set a value to a file input in HTML?
    • Send full client side file path to server side using p:fileUpload
    0 讨论(0)
提交回复
热议问题