locked
WebClient download file problem RRS feed

  • Question

  • I have to download a pdf file from a web location and then read the downloaded file. I am using WebClient DownloadFile method to do the download. It looks like when I login to the server initially, it downloads only 1KB of the PDF file and throws an exception because I am expecting a valid PDF file there though it is not. Then if I open the internet explorer and close it after it opens the default home page, then the program runs perfectly and downloads the PDF (more than 1KB).

    I think this happens again if I don't run the program for sometime or logoff and login to the server. I am not quite sure what is causing it though I can fix it by just opening the browser and then running the program after.

    Does anybody know how to fix this?

    Appreciate any help!

    • Moved by eryang Friday, November 26, 2010 1:17 AM Move to NET forum for better support. (From:.NET Base Class Library)
    Thursday, November 25, 2010 4:13 AM

Answers

  • Nevermind. There was a filter on the server that was blocking the request.

    Thanks

    • Marked as answer by Basani Tuesday, January 4, 2011 3:12 PM
    Tuesday, January 4, 2011 3:12 PM

All replies

  • I appreciate any replies or further insight into this problem.

    • Marked as answer by Basani Tuesday, January 4, 2011 3:11 PM
    • Unmarked as answer by Basani Tuesday, January 4, 2011 3:11 PM
    Sunday, November 28, 2010 3:20 PM
  • Nevermind. There was a filter on the server that was blocking the request.

    Thanks

    • Marked as answer by Basani Tuesday, January 4, 2011 3:12 PM
    Tuesday, January 4, 2011 3:12 PM