We’ve been facing a weird issue with assap 7.0 sp2 and .msg files in SAP GUI. Any file will open from SAP GUI (PDF, TIFF, JPEG) but trying to open a .msg file will prompt user to download an “unknown format” file named as the repository.
However, opening the .msg file from Webtop, any DFC client or the dmview client works just fine.
We tried suggestions from support page (adding mime type to server configuration, to dm_format, etc.) with no luck.
So I decompiled the servlet that sends the response (com.documentum.ei.al.SendHttpResponse):
response.setContentLength((int)numBytesAvail); if (filename != null) { filename = URLEncoder.encode(filename, "UTF-8"); String showFileOpenDialog = PropertiesManager.getALPropValue("archiving.fileOpen.confirmation"); if ((showFileOpenDialog != null) && (showFileOpenDialog.equalsIgnoreCase("true"))) { response.setHeader("content-disposition", "attachment; filename=" + filename); } }
So I decided to turn on the showFileOpenDialog option on al.properties and.. it works! However, this prompts the user with a dialog showing “open/save” options for any file.
So, what’s going on? Well, it looks like that browsers (as I can reproduce this behaviour in any browser by calling the url that SAP GUI uses) won’t handle correctly downloads with mime-types associated to external applications (because files handled by the browser work fine), unless the content-disposition header is set, so in this particular case, to just solve the problem with .msg files:
response.setContentLength((int)numBytesAvail); if (filename != null) { filename = URLEncoder.encode(filename, "UTF-8"); String showFileOpenDialog = PropertiesManager.getALPropValue("archiving.fileOpen.confirmation"); if ((showFileOpenDialog != null) && (showFileOpenDialog.equalsIgnoreCase("true"))) { response.setHeader("content-disposition", "attachment; filename=" + filename); }else{ if (context.getContentType().equalsIgnoreCase("application/vnd.ms-outlook")) { response.setHeader("content-disposition", "inline; filename=" + filename); } } }
and throwing the class into WEB-INF/classes solves the problem