PDF issues using HttpWebRequest
I am using HttpWebRequest/HttpWebResponse to pass information and then retrieve information. I can request fine but the response is a pdf file that seems to look fine but if I save to a file it give me the corrupt error.
The pdf files lookes like the following:
%PDF-1.4
%
1 0 obj <</Filter/FlateDecode/Type/XObject/Length 1565/BitsPerComponent 8/Height 49/Mask [255 255 ]/ColorSpace[/Indexed/DeviceRGB 255(f
It's obviously decoding or something. Is this even possible to save to a file to view?
Thanks.
Re: PDF issues using HttpWebRequest
is this in ASP.NET or in a windows form app?
Re: PDF issues using HttpWebRequest
Re: PDF issues using HttpWebRequest
You need to look at the headers of the WebResponse you are receiving, and if it is a PDF, then you should be handling it differently. You can also use WebClient to download the PDF.
Re: PDF issues using HttpWebRequest
check the link in my signature for downloading a file from a URL with progress