Http Header Content-Disposition
Content-Disposition用途
Content-Disposition是为了实现服务器下载文件功能,并可提供文件名。
Content-Disposition格式
content-disposition = "Content-Disposition" ":"disposition-type *( ";" disposition-parm )
disposition-type = "attachment" | disp-extension-token
disposition-parm = filename-parm | disp-extension-parm
filename-parm = "filename" "=" quoted-string
disp-extension-token = token
disp-extension-parm = token "=" ( token | quoted-string )
例子:
Content-Disposition: attachment; filename="fname.ext"
一般当Content-Type为text、pdf等常见类型时,浏览器会直接打开。如果不想在浏览器内打开文件,可将Content-Type设置为octet-stream二进制类型,浏览器会弹出保存对话框。
注意事项
1 Http Header各项必须是ASCII编码,所以文件名不能有中文字符。
2 Content-Disposition不是http的标准,并不是所有浏览器都兼容,要注意兼容性问题。
Http Header Content-Disposition的更多相关文章
- 启动 angular-phonecat 项目时出现这玩意 。('The header content contains invalid characters');
最近学习angular, 跟着视频做一个动作,启动 “ angular-phonecat ” 这个项目 敲入 “npm start ” 启动没有问题,但是 "http://localhost ...
- 快乐学习 Ionic Framework+PhoneGap 手册1-2{介绍Header,Content,Footer的使用}
*先运行第一个简单的APP,介绍Header,Content,Footer的使用 {2.1}运行一个简单的APP,效果如下 {2.2}Header代码 <ion-header-bar class ...
- spring mvc Response header content type
Xml代码 <bean class ="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAd ...
- window7下karma 报 nodejs request TypeError: The header content contains invalid characters BUG
这个BUG 估计只有中国人才 遇到 打开你的依赖node_modules\karma\node_modules\connect\lib\patch.js 将里面的setHeader方法改成下面这样,干 ...
- window7下karma 报 The header content contains invalid characters BUG
打开你的依赖node_modules\karma\node_modules\connect\lib\patch.js 将里面的setHeader方法改成下面这样,干掉序列化日期时出现的中文 res.s ...
- 使用phpExcel导出excel时,报500错
在自己本地导出excel没有问题,但是放到服务器出现500的错误! 解决方法:查看控制器引用的header文件,是否包含空格,如下: header('Pragma:public'); ...
- PHP header() 函数详细说明(301、404等错误设置)
原文来自:http://www.veryhuo.com/a/view/41466.html 如果您刚刚开始学习PHP,可能有许多函数需要研究,今天我们就来学习一下PHP Header()的使用方法,更 ...
- C# Request中修改header信息
var headers = app.Context.Request.Headers; Type hdr = headers.GetType(); PropertyInfo ro = hdr.GetPr ...
- Jasper_crosstab_columngroup header position config - (headerPosition="Stretch")
Position of Totals RowThe totalPosition attribute controls the appearance of the row that displays t ...
- php 通过curl header传值
下面是自己整理的通过curl header传值 方式是post $url = 'http://www.***.com';//此处为传值需要访问的地址 $header = array('token:J ...
随机推荐
- bzoj4025
首先我们要知道,怎么去维护一个是否是二分图 二分图的充要条件:点数>=2且无奇环 重点就是不存在奇环,怎么做呢 考虑随便维护一个图的生成树,不难发现,如果一条边加入后,形成奇环的话就不是二分图 ...
- 为什么会出现ADB rejected shell command
出现这个问题,是由于在运行过程中,android emulator 没有打开,可以在run configurations--target- automatic-设置自己的android-version ...
- shell 的判断与比较
1 shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of co ...
- 【CSS】使用CSS改变超链接样式
超链接代码 <ahrefahref="http://www.divCSS5.com/"target="_blank" title="关于divC ...
- 【经典DFS】NYOJ-1058-部分和问题
[题目链接:NYOJ-1058] 看到题目难度是2,所以想也没想,直接循环比较...结果果然... 是错的. #include<cstdio> #include<cstring> ...
- 多线程监控文件夹,FlieSystemWatcher,并使用共享函数
发表于: 2011-01-06 09:55:47 C# code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 ...
- 对Spring IoC容器实现的结构分析
本文的目标:从实现的角度来认识SpringIoC容器. 观察的角度:从外部接口,内部实现,组成部分,执行过程四个方面来认识SpringIoC容器. 本文的风格:首先列出SpringIoC的外部接口及内 ...
- [Everyday Mathematics]20150130
计算下列积分 $$\bex \int_0^\infty \frac{\sin^3x}{x^3}\rd x. \eex$$
- webdriver(python)学习笔记七——多层框架定位与智能等待
多层框架或窗口定位: switch_to_frame() switch_to_window() 智能等待: implicitly_wait() 现在web应用中经常会遇到框架如(frame)或窗口(w ...
- NSarray 赋值 拷贝 等问题记录
1. NSArray * a1 = @[@"1",@"2",@"3"]; NSArray * a2 = a1; a1跟a2所指向的地址是一样 ...