首页 新闻 赞助 找找看

安卓手机微信文件下载

0
悬赏园豆:5 [待解决问题]

微信企业号 html5 + ashx 下载文件

苹果上可直接打开docx,xlsx等文件

但安卓手机上无法下载,

哪位大侠指点一下?

多谢!

=========================主要代码:====================

1.

<a href='#'   onclick='downLoadFile(\"" + pDeptName + '\",\"' + pDocName + "\")'>" + pDocName + "</a>

2.

 function downLoadFile(deptname, docname) {            
            location.href = encodeURI("../ajax/downloadFile.ashx?op=docs_wx_download&deptname=" + deptname + '&docname=' + docname + '&channel=wx');
        }

3.

context.Response.Charset = "utf-8";              
context.Response.Clear();          
context.Response.ContentEncoding = Encoding.UTF8;              
context.Response.ContentType = "application/octet-stream";           
context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename=" + HttpUtility.UrlEncode(fname, System.Text.Encoding.UTF8) )   );
context.Response.WriteFile(fnamefull);
context.Response.Flush();               
context.Response.End();

w13617480的主页 w13617480 | 初学一级 | 园豆:3
提问于:2015-08-28 19:03
< >
分享
所有回答(2)
0

只能在游览器里打开,下载吧

无影飞絮剑 | 园豆:1155 (小虾三级) | 2015-08-28 21:39
0

你确定手机浏览器支持html5么?有的浏览器不支持h5,下载就不行了。目前公司做的一个app里面使用的webview就不支持h5,导致下载不成功,不过手机默认的浏览器倒是可以下载。这问题只能慢慢排查了。  你可以直接这样试一试  <a href='文件在服务器上的相对路径'  >" + pDocName + "</a>

wolfy | 园豆:2636 (老鸟四级) | 2015-08-30 11:32
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册