• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

open a file withot pops

 
carlos sanchez
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, first the code:
response.setContentType(mime);
response.setHeader("Content-Disposition", "attachment; filename=" + attFile.getName());
FileInputStream fis = new FileInputStream(ruta);
BufferedInputStream in = new BufferedInputStream(fis);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
javax.servlet.ServletOutputStream sos = response.getOutputStream();
byte binaryByte[] = new byte[16384];
int readCount = 0;
for(readCount = in.read(binaryByte, 0, 16384); readCount >= 0; readCount = in.read(binaryByte, 0, 16384))
sos.write(binaryByte, 0, readCount);

reader.close();
sos.close();
this opens an open-save pop-up. I want to skip this & open it in the app, not the browser.
Any ideas?
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic