@RequestMapping(value = "/downloadSvt")

public ResponseEntity<FileSystemResource> export() {

HttpHeaders headers = new HttpHeaders();

headers.add("Cache-Control", "no-cache, no-store, must-revalidate");

headers.add("Content-Disposition", "attachment; filename=client.js");

headers.add("Pragma", "no-cache");

headers.add("Expires", "0");

File file = new File("./client.js");

return ResponseEntity.ok().headers(headers).contentLength(file.length())

.contentType(MediaType.parseMediaType("application/octet-stream")).body(new FileSystemResource(file));

}

Springboot Download file的更多相关文章

  1. Csharp:WebClient and WebRequest use http download file

    //Csharp:WebClient and WebRequest use http download file //20140318 塗聚文收錄 string filePath = "20 ...

  2. [Powershell] FTP Download File

    # Config $today = Get-Date -UFormat "%Y%m%d" $LogFilePath = "d:\ftpLog_$today.txt&quo ...

  3. Spring boot download file

    Springboot对资源的描述提供了相应的接口,其主要实现类有ClassPathResource.FileSystemResource.UrlResource.ByteArrayResource. ...

  4. FTP Download File By Some Order List

    @Echo Off REM -- Define File Filter, i.e. files with extension .RBSet FindStrArgs=/E /C:".asp&q ...

  5. SpringBoot#Download

    _amaze! 如果不使用fastdfs等分布式的文件存储,有时候还是需要上传文件到web应用所在的服务器的磁盘上,下载文件.下面是一个小demo,关于如何用控制器进行上传和下载. - @PostMa ...

  6. Download file using libcurl in C/C++

    http://stackoverflow.com/questions/1636333/download-file-using-libcurl-in-c-c #include <stdio.h&g ...

  7. httpClient download file(爬虫)

    package com.opensource.httpclient.bfs; import java.io.DataOutputStream; import java.io.File; import ...

  8. jQuery download file

    jQuery.download = function (url, method, p, c, e, i, o, goodsType, reciveUser, suplier) { jQuery('&l ...

  9. download file by python in google colab

    https://stackoverflow.com/questions/15352668/download-and-decompress-gzipped-file-in-memory You need ...

随机推荐

  1. Sockets使用

    服务端 using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Threading ...

  2. 微服务-网关-node.js by 大雄daysn

    目录 序言 一.node.js入门1.1 下载并安装1.2 从helloworld到一个web应用1.3 Express框架二.node.js搭建网关 三.node.js集群搭建   序言 首先一个问 ...

  3. [Oracle][RAC]Oracle RAC环境里打OCW上的个别Patch,然后Rollback,发现OCW也被Rollback掉了

    对于Oracle RAC来说,存在着DB层面的Patch,也存在着GI层面的Patch. 本文介绍的是,GI层面,打Patch----> rollback 的动作之后,原来的OCW被Rollba ...

  4. vs11 微软下载地址

    https://www.microsoft.com/en-us/download/details.aspx?id=30679 vs11 微软的官方下载.最安全

  5. ln 链接命令 简要说明 软硬链接关系说明

    ln [选项] 目标 -s 创建符号链接(软链接) -f 强制创建链接 -i 覆盖前先询问 -v 显示创建链接过程 ln命令不能对目录创建硬链接,但可以创建软链接,对目录的软链接经常被用到 删除软链接 ...

  6. LINK : fatal error LNK1104: cannot open file .exe' 重开application Experience 服务即可

    这是一个坑, , 答案五花八门这个解决了我的痛点.  就这样了.

  7. setTimeout中调用this

    项目案例: 左右切换tab容器的动作,封装到一个对象中: var slidingComp = { startX : 0 , moveX : 0 , ...... start : function(e) ...

  8. nodejs --- formidable模块 , post 上传.

    1. 只有一个文件域: var formidable = require('formidable'), http = require('http'), util = require('util'); ...

  9. wpf UI 布局

    1.Grid *号代表百分比,也可以使用固定值,需要预先设置 有几行几列 以及宽度和高度 ,在表格中的控件需要 表明自己所在第几行 第几列 2.StackPanel 重点需要设置 排列方向 水平还是垂 ...

  10. 我的第一个爬虫程序:利用Python抓取网页上的信息

    题外话 我第一次听说Python是在大二的时候,那个时候C语言都没有学好,于是就没有心思学其他的编程语言.现在,我的毕业设计要用到爬虫技术,在网上搜索了一下,Python语言在爬虫技术这方面获得一致好 ...