更改ice:inputFile组件的上传目录路径 [英] Change the upload directory path for an ice:inputFile component

查看:166
本文介绍了更改ice:inputFile组件的上传目录路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到ice:inputFile组件只会将文件上传到目录$ TOMCAT_HOME / webapps / MyAppName / upload /。我希望此目录依赖于当前用户的用户首字母(即具有首字母abc的用户想要上传文件,该文件转到$ TOMCAT_HOME / webapps / MyAppName / upload / abc /)。如何动态设置此属性?

I've noticed that the ice:inputFile component will only upload files to the directory $TOMCAT_HOME/webapps/MyAppName/upload/. I want this directory to be dependent on the user initials for the current user (i.e. user with initials abc wants to upload a file, the file goes to $TOMCAT_HOME/webapps/MyAppName/upload/abc/). How can I dynamically set this attribute?

推荐答案

需要在组件上设置属性uploadDirectory,如下所示:

Need to set the property uploadDirectory on the component, as such:

<ice:inputFile file="#{Bean.file}" uploadDirectory="./upload/#{Bean.userInitials}/"/>

ICEFaces 网站。

这篇关于更改ice:inputFile组件的上传目录路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆