G
Guest
Hi all,
I'm trying to force downloads from my page specifically for some powerpoint
and jpeg files. using the following code:
Response.ContentType= "APPLICATION/OCTET-STREAM";
string disHeader= "Attachment; Filename=\"" + sFileName + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
System.IO.FileInfo fileToDownload= new System.IO.FileInfo(sDir + sFileName);
Response.WriteFile(fileToDownload.FullName);
Response.Flush();
Response.Close();
Response.End();
My problem is that this works fine on the development (windows XP Pro)
machine but when uploaded to production server (windows 2003 server) it
doesn't work. On the 2003 server it downloads a file with the correct
filename and extension but contains the webpage not the actual file
information!! any ideas??
Thanks
Gav
I'm trying to force downloads from my page specifically for some powerpoint
and jpeg files. using the following code:
Response.ContentType= "APPLICATION/OCTET-STREAM";
string disHeader= "Attachment; Filename=\"" + sFileName + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
System.IO.FileInfo fileToDownload= new System.IO.FileInfo(sDir + sFileName);
Response.WriteFile(fileToDownload.FullName);
Response.Flush();
Response.Close();
Response.End();
My problem is that this works fine on the development (windows XP Pro)
machine but when uploaded to production server (windows 2003 server) it
doesn't work. On the 2003 server it downloads a file with the correct
filename and extension but contains the webpage not the actual file
information!! any ideas??
Thanks
Gav