Firefox

Aug 21, 2007 at 9:59 PM
In Firefox an uploaded file (Word or Excel) identifies as 'compressed folder' when I try to open/download the file.

Anyone else with the same problem?

IE works correctly...
Aug 22, 2007 at 3:58 PM
Solution was to update the method SetContentType in filehandler.cs:

private static void SetContentType(HttpContext context, string fileName)
{
if (fileName.Contains(".pdf"))
context.Response.AddHeader("Content-Type", "application/pdf");
else if (fileName.Contains(".doc"))
context.Response.AddHeader("Content-Type", "application/msword");
else if (fileName.Contains(".xls"))
context.Response.AddHeader("Content-Type", "application/vnd.ms-excel");
}
Aug 22, 2007 at 7:05 PM
Please goranh explain it a bit more :)

Regards.
Aug 22, 2007 at 10:15 PM
If you upload a file you'll get a link to the file:
<a href="/file.axd?file=MyFile.doc">MyFile.doc (size of file)</a>

In Firefox, when I clicked on the link to open or save the file, Firefox wanted to save the file as a compressed folder instead of a word document. The saved file got the wrong extension...

The change in my previous post solved my problem.

Hope this was a better explanation...