Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 343 | Replies: 0
![]() |
•
•
Join Date: Sep 2004
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I've created a jsp that will download a file for the user when its loaded. When this file is downloaded and opened, the end of the file contains this funny character - ΓΏ
Does any one have any idea how to remove this character or prevent this from happening. Here's a code snippet:
Does any one have any idea how to remove this character or prevent this from happening. Here's a code snippet:
<%
//Throw the document
InputStream in = new FileInputStream(uploadDocFile);
OutputStream ros = response.getOutputStream();
response.setContentType("application/msword");
response.setHeader ("Content-Disposition", "attachment;filename="+docFilename);
int bit = 256;
int i = 0;
try {
while ((bit) >= 0) {
bit = in.read();
ros.write(bit);
}
} catch (IOException ioe) {
ioe.printStackTrace(System.out);
}
ros.flush();
ros.close();
in.close();
out.clear();
out = pageContext.pushBody();
%>![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode