L
loffemoffe
I'm running IBM WebSphere and got a problem with filetransfer.
I've got a txt-file with some data in it, but when I open the file
after downloading it the following message gets added in the end of the
text Error 500: OutPutStream already obtained.
What's the problem? Can someone please help me?!
This is my filedownload.jsp:
<jsp:useBean class="com.peregrine.oaa.archway.User" scope="session"
id="user"></jsp:useBean>
<%
.....
sAttachment = "attachment; filename=\""+ sFileNameAtt +"\"";
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", sAttachment);
InputStream is = null;
OutputStream out2 = null;
try
{
out2 = response.getOutputStream();
is = new FileInputStream(request.getRealPath("files/" + sDirectory +
sFileName));
int i;
while ((i=is.read()) != -1)
{
out2.write(i);
}
}
finally
{
if(out2 != null)
{
out2.flush();
out2.close();
}
if (is != null)
{
is.close();
}
}
%>
I've got a txt-file with some data in it, but when I open the file
after downloading it the following message gets added in the end of the
text Error 500: OutPutStream already obtained.
What's the problem? Can someone please help me?!
This is my filedownload.jsp:
<jsp:useBean class="com.peregrine.oaa.archway.User" scope="session"
id="user"></jsp:useBean>
<%
.....
sAttachment = "attachment; filename=\""+ sFileNameAtt +"\"";
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", sAttachment);
InputStream is = null;
OutputStream out2 = null;
try
{
out2 = response.getOutputStream();
is = new FileInputStream(request.getRealPath("files/" + sDirectory +
sFileName));
int i;
while ((i=is.read()) != -1)
{
out2.write(i);
}
}
finally
{
if(out2 != null)
{
out2.flush();
out2.close();
}
if (is != null)
{
is.close();
}
}
%>