vcsrinath
asked on
Download problem
Hi,
i have a problem when i implement the download code in JRun and in weblogic.
It is perfectly working in iPlanet.
the code is this only...
public void download(String strSaveAsfilename,String strFilename,HttpServletRes ponse res,HttpServletRequest req) throws ServletException, IOException
{
ServletOutputStream out= res.getOutputStream();
res.setContentType("applic ation/octe t-stream; name="+strSaveAsfilename+" ");
res.setHeader("Content-Dis position", "inline;fi lename="+s trSaveAsfi lename+"") ;
try{
ServletUtils.returnFile(st rSaveAsfil ename,out) ;
}
catch(FileNotFoundExceptio n fnfe){}
out.flush();
out.close();
}
ServletUtils is the class which is used to read the contents and write it.
The actual problem is
1. illegal state exception is thrown at the very first line itself.
ServletOutputStream out= res.getOutputStream();
How to solve this?
Expecting a solution as early as possible.
Thanx in advance,
SrinathR
i have a problem when i implement the download code in JRun and in weblogic.
It is perfectly working in iPlanet.
the code is this only...
public void download(String strSaveAsfilename,String strFilename,HttpServletRes
{
ServletOutputStream out= res.getOutputStream();
res.setContentType("applic
res.setHeader("Content-Dis
try{
ServletUtils.returnFile(st
}
catch(FileNotFoundExceptio
out.flush();
out.close();
}
ServletUtils is the class which is used to read the contents and write it.
The actual problem is
1. illegal state exception is thrown at the very first line itself.
ServletOutputStream out= res.getOutputStream();
How to solve this?
Expecting a solution as early as possible.
Thanx in advance,
SrinathR
Could you post the whole servlet code, or at least the init, doGet and/or doPost sections?
Sounds like res.getOutputStream() has already been called.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points NOT refunded
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
girionis
Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points NOT refunded
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
girionis
Cleanup Volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.