ASP.Net - Code For File Download

Here is a code that actually download a file for your website visitor:

 

Dim fst As New FileStream(Server.MapPath("abc.txt"), FileMode.Open)

Dim fi As String

fi = "abc.txt"

 

Dim bytBytes(fst.Length) As Byte

fst.Read(bytBytes, 0, fst.Length)

 

fst.Close()

Response.AddHeader("Content-disposition", "attachment; filename=" & fl)

Response.ContentType = "application/octet-stream"

Response.BinaryWrite(bytBytes)

 

Read More: ASP - Simple Login Script

 

                     ASP.Net - Send Email Using System.Web.Mail Class

 

                     Basic ColdFusion Html File

 

                     Web Host - Statistics, Know Your Website Visitors

Hosting Companies insights

2997 Web Hosting Reviews A trusted source of genuine reviews. Learn Reviews
2304 Web Hosting Companies Ever-growing pool of web hosting providers. Browse Providers
2837 Web Hosting Coupons Exciting web hosting deals available here Browse Coupons
Share
Tweet
Share
Share
Share
Email