Richfaces fileUpload:如何设置临时文件的路径以及如何清理它
我在 Tomcat 服务器上使用 Richfaces(在 Linux 下)。我将上传程序更改为 createTempFiles 以节省一些内存。默认情况下,它现在将文件加载到“35f1968e-13267391427--71a74431089769578330705.upload”等文件中的../tomcat/temp/。不幸的是 Tomcat/Richfaces 不会删除这些文件。我该如何启用此功能?如何更改保存文件的文件夹的位置?我尝试了下面的配置,它没有改变任何东西(错误报告 - 如果我理解正确的话,它在 Richfaces v3.3.3 中不可用)
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<description>
Set the path where the intermediary files will be stored.
</description>
<param-name>uploadRepositoryPath</param-name>
<param-value>uploadedfiles/</param-value>
</init-param>
所以如果我无法更改目录(除非某人知道一种方法) - 使用后如何删除临时文件?谢谢!
I'm using Richfaces on an Tomcat Server (under linux). I changed the uploader to createTempFiles to save some ram. By default it now loads the files to ../tomcat/temp/ in files like "35f1968e-13267391427--71a74431089769578330705.upload". Unfortunately Tomcat/Richfaces doesn't delete those files. How may I enable this? And how can I change the location of the folder the files are saved in? I tried the configuration below and it didn't change anything (bug report - if I understand this correctly it is not available in v3.3.3 of Richfaces)
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<description>
Set the path where the intermediary files will be stored.
</description>
<param-name>uploadRepositoryPath</param-name>
<param-value>uploadedfiles/</param-value>
</init-param>
So if I can't change the dir (except sb knows a way) - how to get rid of the temp files after using it? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您上传的文件有多大?无论如何,丰富的组件将上传的文件存储在临时文件夹中。您还可以检查 item.isTempFile() 是否存在并从文件操作中删除。并且您不需要初始化到 DD 中。
onClear 可以添加这个事件。
How big is the file you are uploading? anyway the rich component stores the uploaded file in the temporary folder. you can also check if item.isTempFile() and delete from the file action. And you need not initialize into the DD.
onClear you can add this event.