[英]IS there any way to add files to a deployed web application on tomcat server
我正在使用jsf2 Web应用程序,需要将文件上传到Webcontent的文件夹中并永久保存,我使用了JSF FileUpload Directory中提到的技术,可以将其上传到wtp ...文件夹的子文件夹,但是正如BlueC所说的,当tomcat重新启动时它迷路了,有什么办法吗?
You can store the files in a Database using a BLOB field. 您可以使用BLOB字段将文件存储在数据库中。 It will depends of how you are implementing the persistence layer of your application but in the Java side usually you will implement this field as byte[].
这将取决于您如何实现应用程序的持久层,但是在Java端,通常将此字段实现为byte []。 So it will be comfortable for download or display the file.
因此,可以轻松下载或显示文件。
您可以将文件上传到某个目录/默认目录,然后手动将文件复制到部署目录和应用程序服务器安装之外的安全文件夹中(是的,您可以这样做)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.