Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able to open the same attachment file in the pop-up window  RSS feed

 
RAJESHBISWAS BISWASBISWAS
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requirement:
I have diffrenet attachment links in a JSP.
If I click on the link one pop-up will be opened and the content will be comming from a servlet.
Here is the servlet code
response.setContentType(strMimeType + ";charset=iso-8859-1");
response.setHeader("Content-Disposition", "inline;filename="+strFileName);
ServletOutputStream out = response.getOutputStream();
byte[] data = attachLst.getArrAttachContent();
out.write(data);
out.flush();
out.close();

Problem is that when I click same attachment 2 times first attachment is getting blank and content is comming into the second attachments.
Here is the javascript code where we are opening the pop-up
function getAttachments(fileID,contractNumber,fileName){
var hndlWindow;
var url= "./contractSearchController?ACTION=ATTACHMENTS&ATTACHFILEID="+fileID+"&CONTRACT_NO="+contractNumber+"
&ATTACHFILENAME="+fileName;
if (hndlWindow && !hndlWindow.closed) {
hndlWindow.close();
}
else{
hndlWindow = window.open(url, '' ,
'toolbar=yes,menubar=yes,status=yes,resizable=yes,location=no,'
+ 'scrollbars=yes,width=1150,height=700,top=1');
hndlWindow.moveTo(0,0);
}

}
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RAJESHBISWAS BISWASBISWAS, please adjust your display name to be lower-case or mixed case. The all upper-case display name is considered "shouting" and can be construed as rude.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!