Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

File download using weblogic 6.1(Urgent)

843841Jun 17 2003 — edited Jun 17 2003
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2003
Added on Jun 17 2003
1 comment
90 views