【发布时间】:2013-01-24 13:18:44
【问题描述】:
在使用 ashx 下载文件时需要一些帮助
我正在尝试从外部链接下载大文件(大约 2-4GB)(文件未存储在网络服务器上)
这是我的代码
context.Response.Clear();
context.Response.ContentType = "video/mp4";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName);
context.Response.Write("http://otherserver/file.m4v");
context.Response.Flush();
context.Response.Close();
下载的文件是1kb 我做错了什么? 还有其他下载文件的方法吗? 我正在尝试强制浏览器下载文件(并更改文件名)而不是在浏览器中预览
P.S 对不起我的英语;)
【问题讨论】: