May I know the code that you used for showing the attachment?
Is it a custom code?
Use the standard code provided by SAP for showing the attachments once the user clicks on the hyperlink you are talking about. It will then pop the attachment as you required.
function viewAttach(i){
var message = getCurrentMessageValueCollection();
var itemList = message.getData("Attachments"); //MBO related to the attachment.
var items = itemList.getValue();
var numOfItems = items.length;
var currItem= items[i];
var LS_OUTPUTX =0;
var FILENAME = currItem.getData("Attachments_FILENAME_attribKey").getValue();
var MIMETYPE = currItem.getData("Attachments_MIMETYPE_attribKey").getValue();
var LS_OUTPUTX = currItem.getData("Attachments_LS_OUTPUTX_attribKey").getValue();
showAttachmentContents(LS_OUTPUTX, MIMETYPE, FILENAME);
clearCache();
return false;
}