打成jar部署後,上傳文件找不到正確的文件路徑,因爲jar 不像 tomcat 那種有明確的文件路徑
1.application.properties 添加如下一段話
#上傳文件大小限制
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=500MB
#jar包部署時去掉註釋 www.fhadmin.org
#web.upload-path=h:/
#web.front-path=h:/
#spring.resources.static-locations=file:${web.upload-path},file:${web.front-path}
這裏以 h 盤爲例,也可以是 d 盤,根據情況而定
2. 把 uploadFiles 拷貝到 H 盤目錄下 (uploadFiles 是上傳文件的目錄,這個也根據自己的詳情情況)
這樣上傳文件,都上傳到H盤下的 uploadFiles 目錄裏面去了
3. 如果是 ueditor 文件目錄,ueditor 全部拷貝到硬盤中,比如H 盤
修改配置
plugins\ueditor\jsp\controller.jsp
在 rootPath = rootPath + "/"; 下面
加上一句 rootPath = "H:/";