@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. Jsp 国际化访问首页选择展示不同字体小例子

    要求:创建一个首页,默然显示英文信息,但可以让用户选择使用英文,繁体中文或简体中文. 1.编写hello_en_US.txt,内容如下: cc.openhome.welcome=welcomecc.o ...

  2. linux 安装【jdk、tomcat】查看对外开放端口(防火墙拦截处理)

    1.安装 jdkhttps://www.cnblogs.com/xu-dong/p/6422938.html 查看Linux下查看JDK安装路径: https://www.cnblogs.com/im ...

  3. day 08文件与字符编码

    ASCII  一个字符占一个字节 GBK 中文使用两个字节,英文使用1个字节,使用开头一个比特位标识是英文还是中文 unicode:支持任何国家的语言,全部字符都是使用两个字节 utf-8 一个英文占 ...

  4. L2-023. 图着色问题*

    L2-023. 图着色问题 参考博客 #include <iostream> #include <cstring> #include <set> using nam ...

  5. linux下GCC编译文件

    Linux终端使用技巧: Ctrl+Alt+T打开终端 Ctrl+c死循环退出程序 Shift+Ctrl+T:新建标签页 Shift+Ctrl+N:新建窗口 Shift+Ctrl+Q:关闭终端 终端中 ...

  6. h5 js判断是安卓还是ios设备,跳转到对应的下载地址

    /*ios和安卓跳转 js*/$(function(){ var u = navigator.userAgent; var ua = navigator.userAgent.toLowerCase() ...

  7. ES5与ES6中的继承

    ES5继承在ES5中没有类的概念,所以一般都是基于原型链继承,具体的继承方法有以下几种: 父类: function Father (name) { this.name = name || 'sam' ...

  8. ViewpagerHandler

    import android.os.AsyncTask; import android.os.Handler; import android.os.Message; import android.su ...

  9. PTA寒假二

    7-1 币值转换 (20 分) 输入一个整数(位数不超过9位)代表一个人民币值(单位为元),请转换成财务要求的大写中文格式.如23108元,转换后变成"贰万叁仟壹百零捌"元.为了简 ...

  10. linux的基本操作1

    文件系统 ext4 d: 进入d盘dir /w 以友好的方式列出目录cd     目录名 进入目录cd\      退出目录cd ..    退出到上级目录ipconfig /all 显示本机网络信息 ...