Question:

Using a FileStreamResult in ASP.NET MVC 3, I get a response header like

X-SourceFiles =?UTF-8?B?RDpcUHJvamVjdFxqYWNvYlx0ZXN0?=

Answer:
The header is understood by certain debugging modules in IIS / IIS Express. It contains the base64-encoded path to the source file on disk and is used to link a page's generated output back to that source file. It's only generated for localhost requests, so you don't need to worry about it being displayed to the world when you deploy the application to an actual server.

Updated:

It is not the root cause. I re-checked this issue. only IE has this problem, Chrome is ok. It is caused by the Chinese file name. if the file name doesn't have double byte char, all are ok.  The workaround is to escape the file name when client browser is IE

...
string bName = HttpContext.Current.Request.Browser.Browser;
if (bName == "InternetExplorer")
{
fileName = Uri.EscapeDataString(fileName);
}

  result.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
  result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");

  result.Content.Headers.ContentDisposition.FileName = fileName;
  result.Content.Headers.Add("x-filename", fileName);

...

Why does Http header contains "X-SourceFiles"?的更多相关文章

  1. RestTemplate发送请求并携带header信息

    1.使用restTemplate的postForObject方法 注:目前没有发现发送携带header信息的getForObject方法. HttpHeaders headers = new Http ...

  2. ABP Zero示例项目登录报错“Empty or invalid anti forgery header token.”问题解决

    ABP Zero项目,登录时出现如图"Empty or invalid anti forgery header token."错误提示的解决方法: 在 WebModule.cs的P ...

  3. ASP.NET MVC 3 网站优化总结(三)Specify Vary: Accept-Encoding header

    继续进行 ASP.NET MVC 3 网站优化工作,使用 Google Page 检测发现提示 You should Specify Vary: Accept-Encoding header,The ...

  4. .htaccess添加Header set Cache-Control报错500

    在优化网站开启站点的图片缓存时,需要在.htaccess文件中加入: #文件缓存时间配置10分钟 <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf ...

  5. 如何实现可动态调整隐藏header的listview

    (转自:http://blog.sina.com.cn/s/blog_70b9730f01014sgm.html) 需求:根据某种需要,可能需要动态调整listview的页眉页脚,譬如将header作 ...

  6. PHP header函数设置http报文头(设置头部域)

    PHP HTTP 简介: HTTP 函数允许您在其他输出被发送之前,对由 Web 服务器发送到浏览器的信息进行操作. PHP 5 HTTP 函数:header()     向客户端发送原始的 HTTP ...

  7. 【HTML5&CSS3进阶学习02】Header的实现·CSS中的布局

    前言 我们在手机上布局一般是这个样子的: 其中头部对整个mobile的设计至关重要,而且坑也很多: ① 一般来说整个header是以fixed布局,fixed这个产物在移动端来说本身坑就非常多 ② 在 ...

  8. webservice客户端添加soap Header信息

    根据wsdl文件的header信息,在客户端中添加相应的header 1.wsdl信息如图 <soapenv:Envelope xmlns:soapenv="http://schema ...

  9. HTTP Header 详解

    HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议.HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应.就整个网络资源传 ...

  10. java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.

    分析:android 4.2.X及以下的版本,addHeaderView必须在setAdapter之前,否则会抛出IllegalStateException. android 4.2.X(API 17 ...

随机推荐

  1. android studio友盟分享demo运行报错Gradle's dependency cache may be corrupt解决方法

    gradle-wrapper.properties里修改了gradle的版本,与之前没有报错的项目gradle版本一致.

  2. react native项目的创建和运行

    1.创建项目 react-native init projectName 2.运行项目 在AndroidStudio上运行安卓模拟器 cd projectName react-native run-a ...

  3. iphone导入照片不显示,不同步怎么整

    可以借助itools或者爱思助手来处理 进入电脑软件后 找到文件管理---->文件系统(用户)这个目录 找到photodata这个文件夹,将photos.sqlite文件删除 最重要的一步来了. ...

  4. c#在panel或groupbox中添加窗体,实现点击不同按钮或combox时panel中窗体切换,在xtratabcontrol中添加窗体

    参考panel添加窗体: http://blog.csdn.net/illegalname/article/details/65444249 http://blog.csdn.net/Eastmoun ...

  5. CentOS 利用Yum安装mysql后无法启动(MySQL Daemon failed to start.)

    安装mysql-server [root@iZwz9cl4i8oy1reej7o8pmZ ~]# yum install -y mysql-server 进入/etc执行mysql_install_d ...

  6. winSockets编程(二)socket函数

    初始化DLL之后,接着创建套接字,通过socket()和WSASocket()函数实现此功能. SOCKET socket( int af, int type, int protocol ); af: ...

  7. Android自定义视图二:如何绘制内容

    这个系列是老外写的,干货!翻译出来一起学习.如有不妥,不吝赐教! Android自定义视图一:扩展现有的视图,添加新的XML属性 Android自定义视图二:如何绘制内容 Android自定义视图三: ...

  8. 合理提升WEB前端性能

    前端的优化包括四个部分:HTML结构优化.CSS样式优化.JS行为优化.服务器的优化.合理的前端优化不仅能够提升网站加载速度,而且能够更好的提升用户体验和团队开发效率.所以前端性能优化的重要性是不言而 ...

  9. (记忆化搜索)Jury Compromise (poj 1015)

    http://acm.fzu.edu.cn/problem.php?pid=1005 Description The fastfood chain McBurger owns several rest ...

  10. [Proposal]MyTools

    [名称]:MyTools [需求分析]:现在市场上常用的移动端工具类APP,要么功能单一,如手电筒,录音机,指南针等,要么虽然有多种功能的整合,但只是单一的堆砌,内部依然是一个个独立的功能模块,并未形 ...