`
regedit_123
  • 浏览: 317194 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

attachment和inline的区别

阅读更多
  1. response.addHeader("Content-Disposition""attachment; filename=" + response.encodeURL(downloadfile));  
response.addHeader("Content-Disposition", "attachment; filename=" + response.encodeURL(downloadfile));


注意到第一个值项是attachment,这是真正的关键,设定了这个值,浏览器就会老老实实地显示另存为对话框,如果这个值设成inline,则无论怎样浏览器都会自动尝试用已知关联的程序打开文件。

分享到:
评论
2 楼 regedit_123 2015-10-06  
星水冰云 写道
帮了我大忙了
我这都五年前的文章了,能够帮上真是荣幸!
1 楼 星水冰云 2015-06-26  
帮了我大忙了

相关推荐

    inline_attachment:官方不支持

    要在项目中使用 inline_attachment,请将以下行添加到项目的 config/environment.rb: config.gem 'inline_attachment' 作为 Rails 插件 使用它作为插件安装在 Ruby on Rails 应用程序中: $ script/plugin ...

    OutlookAttachView v2.73

    Attachment With' and 'Copy Selected Attachment To' * Version 1.62 o Fixed bug: OutlookAttachView crashed when trying to extract a special type of attachment. * Version 1.61 o Added 'Mark Inline ...

    jsp页面生成word或excel

    属性设置为attachment文件名带日期格式:浏览器下载 16 jsp文件 16 jsp设置属性为inline,浏览器打开操作 16 七、 利用JExcelApi来动态生成excel文档 17 Test.java类 17 写一个jsp,来利用Test这个javabean输出excel...

    nginx文件强制下载的配置方法

    Content-disposition: inline; filename=foobar.pdf   #表示会下载文件,如火狐浏览器中 Content-disposition: attachment; filename=foobar.pdf nginx配置如下,在相应的server中添加如下location: 代码如下: ...

    content-disposition-parser:解析内容处置HTTP标头

    用于Content-Disposition HTTP标头的小巧且经过全面测试的JS解析器,对于nodejs和浏览器环境零依赖。 该库解析标头字符串,使用可以提取的属性构造对象。 没有验证,没有转换(decodeURIComponent()除外)只是...

    Java邮件开发Fundamentals of the JavaMail API

    Fundamentals of the JavaMail API Presented by developerWorks, your source for great tutorials ... Table of Contents If you're viewing this document online, you can click any of the topics below ...

    JSP实现从数据库导出数据到Excel下载的方法

    //response.setHeader(Content-disposition,inline; filename=videos.xls); response.setHeader(Content-disposition,attachment; filename=test.xls); //以上这行设定传送到前端浏览器时的档名为test.xls //...

    Web前端与移动开发之复合选择器 css元素显示模式 背景属性.txt

    background-attachment: scroll | fixed ; (6)背景复合写法 background:颜色 图片地址url 平铺 滚动 位置 没有顺序要求 (7)背景色半透明 background:rgba(0,0,0,0.3)取值0-1 0.3也可以写成.3 背景色半...

    HTML 网页设计

    background-attachment: fixed; background-position:100% center; } .wrap{ width:95%; margin:0 auto; } /***** Header ****/ .header{ border-top:5px solid #111; } .logo{ text-align:center; margin:10...

    可以显示中文名称的下载组件

    response.setHeader( "Content-Disposition" , "inline; filename=" + toUTF8(f.getName()) ) ; // 文件名应该编码成UTF-8 } // 纯下载方式 else { response.setContentType...

    simple-mail:使用C ++为Qt编写的SMTP库。 允许应用程序通过SMTP发送电子邮件(带有文本,html,附件,内联文件等的MIME)。 支持SSL和SMTP身份验证

    simple-mail:使用C ++为Qt编写的SMTP库。 允许应用程序通过SMTP发送电子邮件(带有文本,html,附件,内联文件等的MIME)。 支持SSL和SMTP身份验证

    css入门笔记

    background-attachment: 取值: 1.scroll 默认值滚动 2.fixed 固定 6.背景图片定位 作用:改变背景图片的位置 属性:background-position: 取值: 1.x y x: 背景图片水平偏移距离 取正向下右 取负向左 ...

    js使用小技巧

    display:inline 隐藏焦点 hidefocus=true 根据宽度换行 style="word-break:break-all" 自动刷新 ;URL=http://c98.yeah.net"> 简单邮件 <a href="mailto:aaa@bbb.com?subject=ccc&body=xxxyyy"> 快速转到...

Global site tag (gtag.js) - Google Analytics