My code so far...
- protected void LinkButton3_Click(object sender, EventArgs e)
- {
- string filename = “~/Users/Kunal/Desktop/Website EasyGo Email/EasyMon Specifications_Rev1.1.pdf”;
- if (filename != “”)
- {
- string path = Server.MapPath(filename);
- System.IO.FileInfo file = new System.IO.FileInfo(path);
- if (file.Exists)
- {
- Response.Clear();
- Response.AddHeader(“Content-Disposition”, “attachment; filename=” +filename);
- Response.AddHeader(“Content-Length”, file.Length.ToString());
- Response.ContentType = “EasyMon Specifications_Rev1.1.pdf”;
- Response.WriteFile(file.FullName);
- Response.End();
- }
- else
- {
- Response.Write(“This file does not exist.”);
- }
- }
- }
Sanwar RanwaPosted Mar 11, 2019, 2:27 AM
Salman BegPosted Mar 11, 2019, 9:52 AM