Question : ASP.NET file download issues on selected machines/browsers

I have a file downloader (wherein the ASP.NET application downloads a file through a dynamically generated hyperlink button to a client browser.  On *some* (just a couple) of client browsers (but always IE), the file is downloaded and the filename is correct, but it looks like the beginning of the download gets munged and/or incorrrectly downloaded at the wrong start index in the stream.

I do not have direct access to the client browsers that are having this issue (isn't that the way this sort of thing goes?) to debug them.  Is anyone aware of an intrinsic IIS/DotNet problem that would cause this issue?   The code is below:


 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
If IO.File.Exists(sDestFileAndPath) Then

                '\\ Package it for sending to Client Browser
                Response.Clear()
                Response.AddHeader("Content-Disposition", "attachment; filename=" & objLinkBtn.Text)
                'Response.ContentType = "application/octet-stream"

                Response.TransmitFile(sDestFileAndPath)
                Response.End()

            End If

Answer : ASP.NET file download issues on selected machines/browsers

Try to add proper content type and content length with Response. Refer below link:
http://dotnetslackers.com/community/blogs/haissam/archive/2007/04/03/Downloading-Files-C_2300_.aspx
Random Solutions  
 
programming4us programming4us