G
Guan
Hi All,
Following ocde is used to download file from unix server, when i try on
window server, the downloading is fine. However when i download from
unix server in binary mode. The file is empty. Is there anything i
should take note of when trying to download file from unix
==============================================================
// Retrieve the file
response.setHeader("Content-Type",
"application/x-download");
response.setHeader("Content-Disposition","attachment;
filename=\"" + fileName);
outputStream = response.getOutputStream();
//outputLocalBuf = new
BufferedOutputStream(outputLocal);
....................................................................
........................................................................
inputStream = new BufferedInputStream((fileName));
int data;
while((data = inputStream.read()) != -1) {
outputStream.write(data);
}
}
thanks
Following ocde is used to download file from unix server, when i try on
window server, the downloading is fine. However when i download from
unix server in binary mode. The file is empty. Is there anything i
should take note of when trying to download file from unix
==============================================================
// Retrieve the file
response.setHeader("Content-Type",
"application/x-download");
response.setHeader("Content-Disposition","attachment;
filename=\"" + fileName);
outputStream = response.getOutputStream();
//outputLocalBuf = new
BufferedOutputStream(outputLocal);
....................................................................
........................................................................
inputStream = new BufferedInputStream((fileName));
int data;
while((data = inputStream.read()) != -1) {
outputStream.write(data);
}
}
thanks