【发布时间】:2015-02-04 07:36:00
【问题描述】:
我在上传文件夹中有不同的文件,包括 .doc、.docx、.pdf、.xls 等,我想在单击图像时下载文件。我从 jquery 值调用 http 通用处理程序正确传递但不工作
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileInfo.Name);
HttpContext.Current.Response.AppendHeader("Content-Length", fileInfo.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.TransmitFile(fileInfo.FullName);
HttpContext.Current.Response.Flush();
【问题讨论】:
标签: jquery httphandler xls