How to write a file to the Response for Internet Explorer Mobile?

Nii

New Member
I am trying to write a file to the response for download. I use:\[code\] Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=" + name); Response.ContentType = GetMimeType(path); Response.BinaryWrite(File.ReadAllBytes(path).ToArray()); Response.End();\[/code\]This works fine on multiple desktop browsers. However, on Internet Explorer Mobile 10 on a Windows Phone 8 devices, it fails. As expected, I get a screen with the message "Tap to open". However, when I tap the message, it navigates to a blank page with the url "Default[2].htm". This is the same no matter what the extension of the file or the MIME Type is. I am stumped as to why this is happening. Is there an alternative method to write files to the response that is compatible with IE Mobile?As I said, this fails regardless of the file extension or MIME type. For one example, I verified the situation was:\[code\]filename: themes.ppt, MIME Type: application/vnd.ms-powerpoint\[/code\]All the files download fine if linked to directly, but I cannot to do this for security reasons. I would prefer not to make a temporary copy of the files and link to those copies, but I will have to do so if I can't find a way to write them to the response.
 
Back
Top