File download using weblogic 6.1(Urgent)
843841Jun 17 2003 — edited Jun 17 2003Hi all,
Iam using weblogic 6.1 and wrote a code to download a file.
Previously when i used the same code , it worked properly in Tomcat but in weblogic it returns some junck values .
the same code is,
<%@page import="java.io.*,com.oreilly.servlet.*,javax.servlet.*;"%>
<%
ServletOutputStream outs = response.getOutputStream();
// Get the file to view
String file = "c:/ww-ww.xls";
// No file, nothing to view
if (file == null) {
out.println("No file to view");
return;
}
// Get and set the type of the file
response.setContentType("application/vnd.ms-excel");
// Return the file
try {
ServletUtils.returnFile(file, outs);
}
catch (FileNotFoundException e) {
out.println("File not found");
}
catch (IOException e) {
out.println("Problem sending file: " + e.getMessage());
}
%>
can anyone say whats the prob .
Thanx all