File Download works in IE but not in Firefox
-
Dim path = "C:\Inetpub\wwwroot\MySite\Files\Downloads\Contact Details.xlsx" Dim file As System.IO.FileInfo = New System.IO.FileInfo(path) If file.Exists Then Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name) Response.AddHeader("Content-Length", file.Length.ToString()) Response.ContentType = "application/octet-stream" Response.WriteFile(file.FullName) Response.End() Else Response.Write("This file does not exist.") End If
can anyone tell me why firefox doesn't recognize file type with this code. i can't open the files downloaded with firefox. -
Dim path = "C:\Inetpub\wwwroot\MySite\Files\Downloads\Contact Details.xlsx" Dim file As System.IO.FileInfo = New System.IO.FileInfo(path) If file.Exists Then Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name) Response.AddHeader("Content-Length", file.Length.ToString()) Response.ContentType = "application/octet-stream" Response.WriteFile(file.FullName) Response.End() Else Response.Write("This file does not exist.") End If
can anyone tell me why firefox doesn't recognize file type with this code. i can't open the files downloaded with firefox.So FF gets the file, but it doesn't open ? Have you done a binary compare ? Are they the same size ? I see no reason why this would not work.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )