使用mvcconfig.xml和<a href下载文件

时间:2019-09-12 09:02:44

标签: spring-mvc

  

Blockquote

我将文件存储在服务器系统中,而不存储在tomcat的Web应用程序文件夹中。我已将文件夹映射到mvcconfig.xml中的相对URI。我正在使用tomcat7:run并对其进行了测试。我可以使用以下任何一种机器下载

Nothing other than this as this is working for xl.

My mvcconfig.xml for relative uri

<mvc:resources mapping="/attachments/**" location="file://${folder.path.mailattachmentPath}" /> where I have given the complete linux folder path where I have stored files in folder.path.mailattachmentPath in application.properties

My HTML code 

<tr ng-repeat="(tIndex, objItem) in displayedCollection"><td align="center">
<a id="tbFileExport{{tIndex}}" style="display: none"
href="{{managetask.path}}{{managetask.ticketNO}}/{{objItem.fileName}}"
download="{{objItem.fileName}}"></a>
{{tIndex+1}} )   <a data-ng-click="downloadFile(tIndex)"
style="color: green">{{objItem.fileName}}</a></td>
</tr>


If I put in the tomcat webpath Ienter code here` am. But files will be downloaded every day. If I do a war movement and if store the files on the web, then it will be deleted. Please suggest
  

Blockquote

0 个答案:

没有答案