用户下载文件后,怎么把这个文件删除?
用户下载文件后,怎么把这个文件删除?
下载文件的代码:
FileInfo file = new FileInfo(reportPath);
Response.Clear();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name));
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/x-bittorrent";
Response.WriteFile(file.FullName);
Response.End();