Hi,
I am new to java.io.* classes, and have a situation where I can't make a
copy of my binary files. Txt are being copied with no trouble but when it
comes to binaries i guess I am missing something since their structured is
changed and are not read by an application correctry (Word, ACDSee etc.).
At the moment, I have a JSP doing something like:
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition", "attachment; filename=\"" +
filename + "\"");
java.io.FileInputStream fileInputStream = new
java.io.FileInputStream(dbBean.getDataPath() + filename);
int i;
while ((i=fileInputStream.read()) != -1) {
out.write(i); }
Please advise of where I am making a mistake or what other class and how
should I use.
Thanks!
I.S.