Sending a file via PrintWriter

Discussion in 'Java' started by Houman, Aug 17, 2004.

  1. Houman

    Houman Guest

    Hi,
    I was wondering how I can send a file (.xls if helps) via PrintWriter
    method. Thanks a lot
     
    Houman, Aug 17, 2004
    #1
    1. Advertising

  2. Houman

    Ryan Stewart Guest

    "Houman" <> wrote in message
    news:...
    > 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.
     
    Ryan Stewart, Aug 17, 2004
    #2
    1. Advertising

  3. Houman

    Frank Guest

    On Tue, 17 Aug 2004 17:49:34 -0500, Ryan Stewart <>
    wrote:

    > "Houman" <> wrote in message
    > news:...
    >> 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.
    >
    >



    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
     
    Frank, Aug 18, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oz Levanon
    Replies:
    1
    Views:
    2,135
  2. Sharp
    Replies:
    5
    Views:
    410
    Paul Lutus
    Oct 15, 2004
  3. Lars Willich
    Replies:
    0
    Views:
    616
    Lars Willich
    Jan 28, 2005
  4. CamT
    Replies:
    1
    Views:
    4,442
    Oscar kind
    Mar 16, 2005
  5. KevinSimonson
    Replies:
    4
    Views:
    997
    Arne Vajhøj
    Oct 1, 2011
Loading...

Share This Page