problem downloading excel file

L

Laltu

Hi,
I am facing a pecular problem.I am generating xls file at app server
and downloading it to the client.But after downloading if the file is
opened it is coming as deformed where as if i am opening the same file
generated at the server it is opening perfectly.can anyone plz help me
regarding this.I am using like this

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;
filetype=.xls");
svrOut = response.getOutputStream();
foIn = new FileInputStream(strDesname);
copyFile(foIn, svrOut);
 
J

Joan

Laltu said:
Hi,
I am facing a pecular problem.I am generating xls file at app
server
and downloading it to the client.But after downloading if the
file is
opened it is coming as deformed where as if i am opening the
same file
generated at the server it is opening perfectly.can anyone plz
help me
regarding this.I am using like this
First I would check to see if the file is being modified.
Use unix 'sum' or 'md5' to check it on both the sending
and receiving machines.
 
L

Laltu

i am not using unix.my app server is weblogic 6.0 and it is running in
windows system.all the sheets are coming in a single sheet and all the
informations are being written at a single cell.
 
D

Darkstar 3D

Probably a header problem. If your header is not correct, the file will
change as it tranverses the internet.
 
B

Babu Kalakrishnan

Laltu said:
Hi,
I am facing a pecular problem.I am generating xls file at app server
and downloading it to the client.But after downloading if the file is
opened it is coming as deformed where as if i am opening the same file
generated at the server it is opening perfectly.can anyone plz help me
regarding this.I am using like this

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;
filetype=.xls");
svrOut = response.getOutputStream();
foIn = new FileInputStream(strDesname);
copyFile(foIn, svrOut);

What does your "copyFile" method look like ?

BK
 
J

Joan

Darkstar 3D said:
Probably a header problem. If your header is not correct, the
file will
change as it tranverses the internet.

I wonder if it has a protocol of "ftp", will it transport in
binary or ascii?
 
D

Darkstar 3D

I would use binary write: response.BinaryWrite(data);

Also, my headers are like this:
response.setHeader("Content-disposition","attachment;filename=Report.xls");

Notice that I used a filename. I always do that, and personnally have
no knowledge about using the filetype.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top