当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
猜你喜欢
Grouping operation aligned with specified datum
Computer TCP / IP interview 10 even asked, how many can you withstand?
向北京集结!OpenI/O 2020启智开发者大会进入倒计时
中国提出的AI方法影响越来越大,天大等从大量文献中挖掘AI发展规律
Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection
GUI 引擎评价指标
分布式ID生成服务,真的有必要搞一个
Troubleshooting and summary of JVM Metaspace memory overflow
车的换道检测
容联完成1.25亿美元F轮融资
随机推荐
Flink on paasta: yelp's new stream processing platform running on kubernetes
【Flutter 實戰】pubspec.yaml 配置檔案詳解
自然语言处理之命名实体识别-tanfordcorenlp-NER(一)
哇,ElasticSearch多字段权重排序居然可以这么玩
ETCD核心機制解析
7.2.1 cache configuration of static resources
Asp.Net Core learning notes: Introduction
Jmeter——ForEach Controller&Loop Controller
对pandas 数据进行数据打乱并选取训练机与测试机集
使用Asponse.Words處理Word模板
连肝三个通宵,JVM77道高频面试题详细分析,就这?
【QT】 QThread部分原始碼淺析
使用NLP和ML来提取和构造Web数据
快快使用ModelArts,零基础小白也能玩转AI!
如果前端不使用SPA又能怎样?- Hacker News
Dapr實現分散式有狀態服務的細節
用Keras LSTM构建编码器-解码器模型
7.2.2 compressing static resources through gzipresourceresolver
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Didi elasticsearch cluster cross version upgrade and platform reconfiguration