前台:

location.href = "/Flow/SB1SP?clxxid=8099b23c-aa5a-44a3-97ef-85eed78145ba";

后台:

publci  ActionResult  SB1SP()

{

FileStream fs = new FileStream(fileName, FileMode.Open);
byte[] bytes = new byte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.ContentType = "application/octet-stream";

Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("123.mdb"));
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();

return ActionResult  ();

}

MVC 下载相关的更多相关文章

  1. MVC下载文件方式

    MVC下载文件方式 http://www.cnblogs.com/liang--liang/archive/2012/10/20/2732745.html 方式一: public FileStream ...

  2. mvc下载文件

    MVC下载文件方式 方式一: public FileStreamResult DownFile(string filePath, string fileName)  {       string ab ...

  3. Asp.net mvc 下载文件

    前言 最近有需求需要下载文件,可能是image的图片,也可能是pdf报告,也可能是微软的word或者excel文件. 这里就整理了asp.net mvc 和asp.net webapi 下载的方法 A ...

  4. KaliLinuxNetHunter教程下载相关资源

    KaliLinuxNetHunter教程下载相关资源 当用户将刷机工具准备完后,则需要下载ROM包.ROM是ROM image(只读内存镜像)的简称,常用于手机定制系统.一般手机刷机的过程,就是将只读 ...

  5. MVC下载文件方式 包括网络地址文件

    MVC下载文件方式 方式一: public FileStreamResult DownFile(string filePath, string fileName){      string absol ...

  6. Folx中与下载相关的参数如何设置

    Folx是一款简单易用,功能强大的MacOS专用下载管理工具.要使Folx下载/上传速度快,同时又不影响其他软件的上网使用,还能够有计划地安排下载,那么就必须对Folx进行参数设置.接下来小编详细讲解 ...

  7. spring mvc 项目 相关配置文件小结

    web.xml文件主要配置如下: 需要加载的配置文件: 类路径下,可以使用通配符配置  类似:classpath:conf/spring/*/*.xml, <context-param> ...

  8. Maven:jar 下载相关的问题

    在使用Maven下载jar包时,会遇到一些问题,如何解决他们呢? 1.仓库里有jar 包,更新Maven时报仓库里找不到jar包的错误 这个问题,时常在版本有大的变动时出现.(例如:新增加了一些fea ...

  9. [原创]java WEB学习笔记72:Struts2 学习之路-- 文件的上传下载,及上传下载相关问题

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

随机推荐

  1. Failed to import pydot

    在使用keras进行模型绘制的时候,出现了一个错误 Failed to import pydot. You must install pydot and graphviz for `pydotprin ...

  2. tkinter.py

    from tkinter import * def hello():print('hello world') win=Tk() win.title('hello tkinter') win.geome ...

  3. AndroidStudio设置“自动导入包”

    setting –-> Editor –-> General –-> Auto Inport 勾选这两项 单击 Apply –-> ok

  4. aidl笔记 2/5/2015

    interface Test { //测试的接口 void fun();} Stub 是一个Binderclass Stub extend Binder implements Test { publi ...

  5. ubuntu12.04下有线网无电缆插入问题

    解决方案: 1.查看是否没装网卡驱动: 2.检查网卡是否损坏: 3.检查网线是否损坏(注意:有时候不一定是网线损坏了,而是网线太细了,导通性不好.本人用细网线试了一下,windows下面可以连接网络, ...

  6. Outlook 开发2

    转自:http://www.cnblogs.com/madebychina/archive/2011/09/20/madebychina_2.html C#使用如下代码调用Outlook2003发送邮 ...

  7. CF-798C

    C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  8. java集合框架之HashCode

    参考http://how2j.cn/k/collection/collection-hashcode/371.html List查找的低效率 假设在List中存放着无重复名称,没有顺序的2000000 ...

  9. 牛客 - 17968 - xor序列 - 线性基

    https://ac.nowcoder.com/acm/problem/17968 下面是错误的做法,因为题目要求必须使用x,而y在check的时候不一定用到等价于x的线性基来构成. 正确的做法是直接 ...

  10. ios NSFileManager创建目录、文件

    NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *str1 = NSHomeDirectory(); _fi ...