Download pdf programatically...
- by Perplexed
Hi,
How can I download a pdf and store to disk using vb.net or c#?
The url (of the pdf) has some rediection going on before the final pdf is reached.
I tried the below but the pdf seems corrupted when I attempt to open locally,
Dim PdfFile As FileStream = File.OpenWrite(saveTo)
Dim PdfStream As MemoryStream = GetFileStream(pdfURL)
PdfStream.WriteTo(PdfFile)
PdfStream.Flush()
PdfStream.Close()
PdfFile.Flush()
PdfFile.Close()
many thanks,
KS