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. CAS 单点登录 服务器整合

    概述 现在企业内部的系统越来越多,如果各个应用都有自己的用户系统,那么用户将不得不要记住不同系统的用户名密码,因此独立的用户系统应运而生,各个系统之间通过单点登录的方式,这样内部只需要记住一个用户名和 ...

  2. Livelock

    Unlike deadlock, livelocked packets continue to move through the network, but never reach their dest ...

  3. greenplum 开启和关闭服务

    1.关闭服务$pg_ctl stop -m fast -D $MASTER_DATA_DIRECTORY (/usr/local/greenplum-db/bin) 2.开启服务 $pg_ctl st ...

  4. s5-12 RIP

    什么是RIP? RIP:Routing information protocol,路由选择信息协议 1988年,RFC1058 RIPv1:有类的路由选择协议 RIPv2:无类的路由选择协议,支持CI ...

  5. 不同数据源之间的数据同步jdbc解决方案

    最近项目中用到的数据要从一个数据源获取存进另一个数据源,简单的jdbc解决方案. package com.sh.ideal.test.syns; import java.sql.Connection; ...

  6. printk()、查看开机log、查看实时log

    要将linux内核的带级别控制的printk内容打印出来,在命令行 输入 dmesg -n 8 就将所有级别的信息都打印出来 Linux命令:dmesg 功能说明:显示开机信息. 语 法:dmesg ...

  7. c++ cout、<< 、cin、>> 、endl 详解

    std::cout是在#include<iostream>库中的ostream类型中的对象 std::表示命名空间,标准库定义的所有名字都在命名空间std中 std::cout是在#inc ...

  8. CAAnimation-CAPropertyAnimation-CABasicAnimation-CAKeyframeAnimation

    参考博客 iOS关于CoreAnimation动画知识总结 http://www.cnblogs.com/wujy/p/5203995.html iOSCoreAnimation动画系列教程(一):C ...

  9. shell工具-sort

    sort sort命令是在Linux里非常有用,它将文件进行排序,并将排序结果标准输出 基本语法 sort [选项] [参数] 选项说明 选项 说明 -n 依照数值大小排序 -r 以相反的顺序排序 - ...

  10. 必修3第三章概率mindmaps

    % !Mode:: "TeX:UTF-8" \documentclass{article} \usepackage[screen]{geometry} \usepackage[no ...