javascript - Excel file opened from IE doesn't exist, but does -
i have user who, when download excel file hosted on our intranet, receives error message telling them file doesn't exist. occurs in ie.
i've verified file in fact exist, , can accessed other users same permissions in same geographic location. not interop issue - file being hosted. able reproduce issue once machine in ie 9 opening file @ open/save prompt, after excel asked me authentication credentials 3 times, gave me same error, opened file anyway. have since been unable reproduce it. computer "open file anyway."
i stumped. have ideas?
error message: microsoft office excel cannot access file . there several possible reasons:
- the file name or path not exist.
- the file being used program.
- the workbook trying save has same name open workbook.
edit
the user using ie 7.
code serving file:
<asp:linkbutton id="lbtnestimatingworkbook" runat="server" cssclass="brightness" tooltip="estimate calculation workbook" tooltip="open estimating workbook in excel" onclientclick="displayestimateworkbook()"></asp:linkbutton> function displayestimateworkbook() { var url = "estimating workbook.xlsm"; var win = window.open(url, '_blank'); win.focus(); }
turns out along our production path (probably generic iis setting), outside of application, adding "pragma: no-cache" header. preventing ie8 (or earlier) downloading because of terrible way ie handled downloads.
adding following init method of page fixed problem , allowed downloads (only works iis 7+):
response.headers.remove("pragma") response.addheader("pragma", "cache") response.cache.setcacheability(httpcacheability.private) response.cache.setmaxage(new timespan(0, 15, 0))
this question has more information.
Comments
Post a Comment