战争中的grails文件上传管理 [英] grails file uploads management in wars
问题描述
我的问题是,我不知道什么是自动执行战争部署并保留此文件夹的最佳方式。因为当我在Tomcat中重新部署时,整个应用程序文件夹被删除并且所有文件都被删除。
另外我需要一个通用配置fron从这个文件设置一个外部位置
p>您是否找到了解决方案? PD:如果我使用System.properties ['base.dir'],结果为null,如果我使用ApplicationHolder.application.mainContext.getResource()它返回一个临时路径。 :
您不应该将文件上传到您的WAR结构中,您应该将它们上传到某个外部位置。 >
I have developed a grails app which has user file uploads (docs, etc..), they are stored in the relative folder "web-app/upload".
My question is that I do not know what is the best way to perform automatically war deployments and keep this folder. Because when I redeploy in Tomcat the whole app folder is deleted and all the files are deleted.
Additionaly I need a generic configuration fron set an external location from this Files
Have you found a solution for that?
P.D.: If I use System.properties['base.dir'] the result is null, and if I use a ApplicationHolder.application.mainContext.getResource() it return a temp path. :(
You should not be uploading files into your WAR structure. You should upload them to some external location.
这篇关于战争中的grails文件上传管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!