I wonder if the problem is not with POI.

i laod my excel file with httpresponse and, my file lose the format, i got a message where the Ms Excel informe me that this file is endomaged. but the
file is opened with MsExcel 2000 and openOffice.

Tell us about your workflow.

(1) Are you making your HTTP request from within Excel and OpenOffice, or are you making the request in a Browser like Internet Explorer and then saving the file?

(2) What servlet container do you use? What version?

(3) Are you using a servlet or a JSP?

JSPs are meant for Text only and you get in trouble if you don't have every "%>" immediately followed by a "<%". If you have this:

.... %>
<% ....

before your code then JSP will send a whitespace character in the response and this could certainly cause trouble.

You can see if you use Josh's command but with the url you use to hit your server.

curl -s http://localhost:8080/yourwebapps/yourtemplaterequest | hexdump -n 8 -e

(4) Does your url end with ".xls"?

Older version of windows and IE seem to require this help. We used to add an extra parameter to the request to fix the issue.

HTH,
Dave

On Jan 30, 2009, at 4:29 PM, Josh Micich wrote:

Hello Hicham,

The two files you uploaded open OK in POI (i.e. WorkbookFactory.create()
completes normally).

I do not know how to verify the spreadsheet formats
You can also check the initial bytes of these files easily from a unix
prompt with something like this:

$ curl -s http://www.nabble.com/file/p21746193/input.xls | hexdump - n 8 -e
'16/1 "%02X " "\n"'
D0 CF 11 E0 A1 B1 1A E1

$ curl -s http://www.nabble.com/file/p21746193/outout+2+.xls | hexdump -n 8
-e '16/1 "%02X " "\n"'
D0 CF 11 E0 A1 B1 1A E1

These 8 bytes are consistent what is expected in the 'Microsoft Compound
Document' format.  This is expected since POI didn't report an error.

I am having trouble understanding what the exact problem is.  I tried
opening the two files in Excel (2007) and that was OK too.

regards,
Josh


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to