更改ice:inputFile组件的上传目录路径

发布于 2024-08-05 08:24:17 字数 173 浏览 7 评论 0原文

我注意到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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后eg是否自 2024-08-12 08:24:17

如参考指南中所示
http://www.icefaces.org/docs/v1_8_2/htmlguide/devguide /references5.html

web.xml 文件:

要指定存储上传文件的目录位置,使用以下参数:

<param-name>com.icesoft.faces.uploadDirectory</param-name>

<param-value>youruploaddirectory</param-value>

此参数与ice:inputFile 组件属性“uniqueFolder”结合使用,具有四种可能的组合,如下所示:

                           **com.icesoft.faces.uploadDirectory**

                                   Set                                 Not Set

  **uniqueFolder**

   True           /app-context/uploadDirectory/sessionid/     /app-context/sessionid/

   False          /app-context/uploadDirectory/           /app-context/         

注意:可以在每个实例上覆盖通过上述配置参数指定的默认上传目录通过ice:inputFile 组件上的uploadDirectory 和uploadDirectoryAbsolute 属性来实现。

希望这有帮助!

As indicated in the reference guide
http://www.icefaces.org/docs/v1_8_2/htmlguide/devguide/references5.html

web.xml file:

To specify the directory location where uploaded files are stored, the following parameter is used:

<param-name>com.icesoft.faces.uploadDirectory</param-name>

<param-value>youruploaddirectory</param-value>

This parameter works in conjunction with the ice:inputFile component attribute "uniqueFolder" with four possible combinations as illustrated below:

                           **com.icesoft.faces.uploadDirectory**

                                   Set                                 Not Set

  **uniqueFolder**

   True           /app-context/uploadDirectory/sessionid/     /app-context/sessionid/

   False          /app-context/uploadDirectory/           /app-context/         

Note: The default upload directory specified via the configuration parameters above can be overridden on a per-instance basis via the uploadDirectory and uploadDirectoryAbsolute attributes on the ice:inputFile component.

Hope this helps!

天暗了我发光 2024-08-12 08:24:17

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

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

ICEFaces 站点。

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

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

This property is (currently) not mentioned in the JavaDoc for this component on the ICEFaces site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文