Re: Help With Using System.Text.Encoding To Download File

Tech-Archive recommends: Fix windows errors by optimizing your registry



<A_StClaire_@xxxxxxxxxxx> wrote:
I am using the following code to download multiple file types from a
server. .txt files transfer fine. however Word .doc files come
through garbled and I don't know enough about encoding to understand
why.

You shouldn't be useing an encoding at all. Word files are binary files
- Encodings are only to be used for plain text files. You should just
use Streams to read/write binary files.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Telling an empty binary file from a "full" one
    ... >report the lengths of binary files. ... the magic encoding shows up. ... does not end with a newline. ...
    (comp.lang.c)
  • Re: What is the logic of storing XML in a Database?
    ... I have heard all the arguments for text formats, ... more binary files with fewer problems than it does html ... encoding and decoding at the endpoints. ... All the bytes in a jpeg file have the same encoding, ...
    (comp.databases.theory)
  • Re: Decode help please
    ... A picture file compressed via yEnc, an encoding for transferring ... The overhead can be as little as 1-2% compared to the 33%-40% of other ...
    (misc.news.internet.discuss)
  • Re: Read binary data file
    ... ASN.1 encoding, what I am pointing out is that binary files are usually ... There is nothing wrong with simply writing ... the code, and not some specification, drives the format of the data - and there ...
    (comp.lang.java.programmer)
  • Re: Help With Using System.Text.Encoding To Download File
    ... You shouldn't be useing an encoding at all. ... use Streams to read/write binary files. ... Jon Skeet - ... int ret = s.Receive; ...
    (microsoft.public.dotnet.languages.csharp)