问个关于下载的小问题
private void SendToClient(string filepath)
{
FileInfo file = new FileInfo(filepath);
Page.Response.Clear();
Page.Response.AppendHeader("Content-Disposition", "attachment; filename=" + Page.Server.UrlEncode(file.Name));
Page.Response.AppendHeader("Content-Length", file.Length.ToString());
Page.Response.ContentType = "application/octet-stream";
Page.Response.WriteFile(file.FullName);
Page.Response.End();
}
通过调用这个方法,我可以提供给用户下载一个文件,但是现在问题是我有两个问题,但是这个方法调用一次后就不行了,请问要如何解决这个问题?