Web Hosting Articles
Categories
- Web Hosting (34)
- Control Panels (13)
- Dedicated Servers (12)
- Virtual Private Servers (9)
- Unix Linux Web Hosting (8)
- Domain (5)
- MS SQL Database Servers (5)
- Email Accounts (4)
- Web Hosting Plan (3)
- Shared Hosting (3)
- Hardwares (3)
- Windows Web Hosting (2)
- Costing (2)
- Reseller Hosting (1)
- Log Files (1)
- FTP Access (1)
- Ecommerce (1)
- Unlimited Hosting (1)
- Unmanaged Dedicated Servers (1)
- Multiple Domain Hosting (1)
- Plesk Web Hosting (1)
- Managed Dedicated Servers (1)
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)
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)
Rate This Article
Recent Comments
Add comment
Web Hosting Directory
-
The web hosting directory is for anyone who is searching for website hosting and hosting related resources. The directory is listing Shared, VPS and Dadicated server plans in descending order for customer ratings !!! This web hosting directory is listing plans on the basis of 100% unbiased customer ratings. TheWebHostingDir.com provides you nice tool to easily search all types of web hosting plans including cheap web hosting, ASP.Net hosting, php mysql hosting, Cheap VPS Hosting, Windows VPS, HyperV VPS, Xen VPS and Cpanel VPS Hosting.

Quick search
Request a Quote
If you wish to receive proposals from Web Hosting Companies Suited to your needs.




Pzx2R0 pmuawwqfhqxnPosted by : szwuizia Feb 4th, 2012
FDfUSK , [url=http://xblbzzbvwlvn.com/]xblbzzbvwlvn[/url], [link=http://ozqacmnvnvvy.com/]ozqacmnvnvvy[/link], http://ezjiazpirhtr.com/Posted by : hgvfnxkxm Feb 4th, 2012
BVYwex qqkzbaeunzjmPosted by : mfzskdbvse Feb 3rd, 2012
Call me wind because I am absuoltely blown away.Posted by : oukmwdudutz Feb 3rd, 2012
Very useful and rare piece of information! Thanks.Posted by : Cash Feb 2nd, 2012
Great post, also, do not forget to end the response by adding the line \'Response.End()\' at the end of the code block. Otherwise the file will be appended with the entire page code.Posted by : Veli Pehlivanov Apr 23rd, 2009
Posted by : Eduardo Cabre Mar 19th, 2009