Greg,
In addition to the other comments, it sounds like you are not reading a
binary file!
Either on your read or your write (or both) you have an System.Text.Encoding
object set, as BinaryWriter, TextWriter, and StreamWriter all have an
Encoding property.
I would simply read the underlying Stream object form the HttpWebRequest for
input & FileStream for output and read & write blocks of raw bytes. Thus
avoiding any potential encoding problems.
In other words I would not use a BinaryWriter, TextWriter, and StreamWriter
nor a BinaryReader, TextReader or a TextWriter.
Hope this helps
Jay
"Greg" <no****@nospam.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Using the HttpWebRequest I'm downloading a PDF file and am trying to save
it to the hard drive, but it keeps ending up corrupt (according to adobe
acrobat). I know the PDF file isn't corrupt because I can view it if I
save it from IE.
I've tried saving it using the BinaryWriter, TextWriter, and StreamWriter.
All have produced the corrupt file.
Anyone know what the problem is?