当前位置:网站首页>7.3.2 File Download & big file download
7.3.2 File Download & big file download
2020-11-06 01:14:00 【Memory】
All the source code in the project can be found in the linked repository :https://github.com/chenhaoxiang/uifuture-ssm
List of articles
7.3.2 adopt ResponseEntity Download the file
7.3.1 Section shows the transfer of files and objects , Now let's show you Spring MVC File download in .
The file download is relatively simple , You can also download files directly from the page by accessing the hyperlink to the file . But if the file name is Chinese name , It's possible that in some early browsers, it could lead to garbled code , So the download failed .
Spring MVC Provides ResponseEntity type , It is very convenient to define return header, return file name and status code .
stay FileController Add download method in . Take a look at Controller Class provides the download file method , Such as code list 7-27 Shown .
Controller Download method of layer
Code list 7-27:Controller Download method of layer
/**
* If there's a big file , Meeting OOM.
* There will be java.lang.OutOfMemor
版权声明
本文为[Memory]所创,转载请带上原文链接,感谢
边栏推荐
- Every day we say we need to do performance optimization. What are we optimizing?
- Basic principle and application of iptables
- The practice of the architecture of Internet public opinion system
- Grouping operation aligned with specified datum
- 利用 AWS SageMaker BlazingText 对不均衡文本进行多分类
- 01 . Go语言的SSH远程终端及WebSocket
- Existence judgment in structured data
- [译] 5个Vuex插件,给你的下个VueJS项目
- 读取、创建和运行多个文件的3个Python技巧
- DevOps是什么
猜你喜欢
随机推荐
How to get started with new HTML5 (2)
微信小程序:防止多次点击跳转(函数节流)
Asp.Net Core learning notes: Introduction
Leetcode's ransom letter
JetCache埋点的骚操作,不服不行啊
6.9.2 session flashmapmanager redirection management
Flink on paasta: yelp's new stream processing platform running on kubernetes
Vue.js移动端左滑删除组件
Serilog原始碼解析——使用方法
神经网络简史
你的财务报告该换个高级的套路了——财务分析驾驶舱
【QT】 QThread部分原始碼淺析
网络安全工程师演示:原来***是这样获取你的计算机管理员权限的!【维持】
Pattern matching: The gestalt approach一种序列的文本相似度方法
怎么理解Python迭代器与生成器?
C language 100 question set 004 - statistics of the number of people of all ages
從小公司進入大廠,我都做對了哪些事?
面经手册 · 第12篇《面试官,ThreadLocal 你要这么问,我就挂了!》
使用Asponse.Words處理Word模板
Flink的DataSource三部曲之二:内置connector




