Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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.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 =, 0, 16384); readCount >= 0; readCount =, 0, 16384))
sos.write(binaryByte, 0, readCount);

this opens an open-save pop-up. I want to skip this & open it in the app, not the browser.
Any ideas?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!