Sending a file via PrintWriter

H

Houman

Hi,
I was wondering how I can send a file (.xls if helps) via PrintWriter
method. Thanks a lot
 
R

Ryan Stewart

Houman said:
Hi,
I was wondering how I can send a file (.xls if helps) via PrintWriter
method. Thanks a lot
Not likely to work well since XLS files are binary and Writers transfer
character data.
 
F

Frank

Not likely to work well since XLS files are binary and Writers transfer
character data.


While it's true, that unless you know something about the file, you should
treat it as binary, and hence using any form of Writer will be a bad idea,
unless you opt to use some sort of encoding, such as Base64.

As for XLS... I thought the new versions (2002 and future versions) of
Excel (or rather MS Office files in general) were a proprietary element
set, but the file was itself pure XML? In which case, you should be able
to obtain a Reader for the file (you'll need to make sure to select one
using the right charset) and then load from the reader into a char[], then
write back to your Writer.

HTH

Frank
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top