VB.NET
Response.Clear()
Response.AppendHeader('content-disposition', 'attachment; filename=document1.doc')
Response.ContentType = 'text/plain'
Response.WriteFile(Server.MapPath('document1.doc'))
Response.Flush()
Response.End()
C#
Response.Clear();
Response.AppendHeader('content-disposition', 'attachment; filename=document1.doc');
Response.ContentType = 'text/plain';
Response.WriteFile(Server.MapPath('document1.doc'));
Response.Flush();
Response.End();
Share with