How to disable or remove the "Open" option [file download window ]
-
How do I disable or remove the "Open" option in the file download window in my aspx page? Can somebody please help? Thanks! I have been used the below code in my page.... That's why, there is no file in my Cache. Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore();
Jey
-
How do I disable or remove the "Open" option in the file download window in my aspx page? Can somebody please help? Thanks! I have been used the below code in my page.... That's why, there is no file in my Cache. Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore();
Jey
You might not have that much control over the File Download dialog box as it is fully controlled by the web browser. To trigger the dialog, I guess, you should be using
Content-Disposition
with the full file name like (filename.xls
) [including the extension right]. You can tweak the headers and try sending the MimeType which is that of EXE. Normally, for Security reasons, Internet Explorer disables'Open'
for EXE and also the 'Checkbox
' right? But this might not be a complete solution neither a cross-browser compatible one.Vasudevan Deepak Kumar Personal Homepage Tech Gossips