Android版Chrome浏览器改名不必要的姓名和放大器;类型的下载文件 [英] Android Chrome browser unnecessarily renames names & types of downloaded files

查看:258
本文介绍了Android版Chrome浏览器改名不必要的姓名和放大器;类型的下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我会重新发布这个,因为我有更多的详细信息:

I thought I'd repost this since I have more detailed information:

问题:Android版Chrome浏览器重命名文件在所有情况下,下载。它重命名在某些情况下,以.BIN(若扩展名是MOV格式,例如)类型。正如我之前提到的,同样的Andr​​oid设备上的Firefox和海豚浏览器应用程序不会出现此行为。文件被正确下载。作为一个方面说明,我已经尝试过指定没有运气锚元素中的下载属性。 下载属性得到甚至在这种情况下,Android版Chrome浏览器忽略。我的直觉是,这是因为在路上,我们正在串流的下载属性被忽略的文件。另外要注意的是,Chrome浏览器的桌面版本下载文件,而不问题(不重命名)。我觉得有内置到Chrome浏览器的一些安全功能,导致这些重命名probs。

THE ISSUE: Android Chrome browser renames a file to "Download" in all cases. It renames the type to ".bin" in some instances (if the extension is .MOV, for instance). As I've mentioned before, the Firefox and Dolphin browser apps on the same Android device don't exhibit this behavior. The files are downloaded correctly. As a side note, I already tried specifying a "Download" attribute within the Anchor element with no luck. The "Download" attribute gets ignored even by the Android Chrome browser in this case. My hunch is that it's because of the way we're streaming the file that the "download" attribute is being ignored. Another thing to note is that the desktop version of the Chrome browser downloads files without the issue (no renaming). I think there's some security feature built into the Chrome browser that is causing these renaming probs.

背景资料:该网站的服务器是在Windows Azure云IIS 7.5。在使用Web应用程序是微软路由的MVC框架。因此,当选择了一个文件,从Chrome浏览器的Andr​​oid设备中下载,服务器上的下载方法使用MS MVC路由访问。在这个方法中,我们指定的标题信息和流斩使用HTT presponse文件片段。这精美的作品为Android设备上的任何其他浏览器的应用程序(Firefox和海豚,例如),并能保存正确的文件名和类型。有了Chrome,但是,文件和类型(有时)被改名。

BACKGROUND INFO: The web server is IIS 7.5 on a Windows Azure cloud. The web application in use is Microsoft's MVC framework for routing. So when a file is selected to download from the Chrome browser within an Android device, a download method on the server is accessed using MS MVC routing. Within this method, we're specifying the header information and streaming chopped up pieces of the file using httpResponse. This works beautifully for any other browser app on the Android device (Firefox and Dolphin, for instance) and is able to save with the correct file name and type. With Chrome, however, the file and type (sometimes) gets renamed.

下面是当我下载一个.mov文件的响应报头:

Here are the response headers when I download a .MOV file:

* HTTP / 1.1 200 OK缓存控制:私人,S-达到maxage = 0
内容长度:54295903
内容类型:应用程序/八位字节流
服务器:Microsoft-IIS / 7.5
的X AspNetMvc-版本:4.0
内容处置:附件;文件名
的= UTF-8''MyVideo.MOV
的X ASPNET-版本:4.0.30319
的X技术,通过:ASP.NET日期:星期六,2013年6月29日5时01分32秒GMT **

*HTTP/1.1 200 OK Cache-Control: private, s-maxage=0 Content-Length: 54295903 Content-Type: application/octet-stream Server: Microsoft-IIS/7.5 X-AspNetMvc-Version: 4.0 Content-Disposition: attachment; filename=UTF-8''MyVideo.MOV X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Sat, 29 Jun 2013 05:01:32 GMT**

HELP!:我想AP preciate上一个变通的任何意见。另外,我想AP preciate从别人一个明确的字谁在谷歌开发社区合作,是否这将是固定在未来的更新。谢谢!

HELP!: I would appreciate any advice on a work-around. Also, I would appreciate a definite word from somebody who works in the Google dev community as to whether this will be fixed in the next refresh. Thanks!!

推荐答案

内容处置有被Android上的一个问题的历史。你肯定欢迎尝试删除 UTF-8 部分,看看是否有帮助Chrome浏览器。但可以肯定的测试原生Android浏览器应用程序,以及作为数字这对Android的最流行的浏览器。

Content-Disposition has a history of being a problem on Android. You are certainly welcome to try removing the UTF-8 part and see if that helps Chrome. But definitely test the original Android Browser app as well, as numerically that's the most popular browser for Android.

另请参阅:

  • http://code.google.com/p/android/issues/detail?id=11422
  • Android browser/webview bug? Content-Disposition: attachment; filename="xyz.txt"
  • http://code.google.com/p/android/issues/detail?id=9991
  • http://thedigiblog.wordpress.com/2011/04/19/android-and-the-download-file-headers/

这篇关于Android版Chrome浏览器改名不必要的姓名和放大器;类型的下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆