如何预设 p:fileUpload 的值 [英] How to preset the value of p:fileUpload
本文介绍了如何预设 p:fileUpload 的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用
组件.是否可以在浏览按钮之前的字段中预选并显示所选文件?
I am using <p:fileUpload>
component. Is it possible to preselect and show the selected file in field before the browse button?
我使用的是 Mojarra 2.0.3、PrimeFaces 2.2 RC2、GlassFish 3.
I am using Mojarra 2.0.3, PrimeFaces 2.2 RC2, GlassFish 3.
推荐答案
不,如果可能的话,这将是一个巨大的安全漏洞.理论上,您可以让所选文件指向 C:/path/to/passwords.txt
,然后使用 JavaScript 提交表单,然后静默地从未经其许可的客户.
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.
这篇关于如何预设 p:fileUpload 的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文