-
Notifications
You must be signed in to change notification settings - Fork 0
/
downloadFile.aspx.cs
27 lines (26 loc) · 946 Bytes
/
downloadFile.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace statistika_net4.statistika
{
public partial class downloadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String fileName = Request.QueryString["fileName"];
String excellFilePath = Request.QueryString["excellFilePath"];
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ";");
response.TransmitFile(excellFilePath.Replace('*','\\'));
response.Flush();
response.End();
}
}
}