This issue got resolved when I added following line in my code for downloading the file:"
downloadFileHttpRequest.UserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3";
Thanks JohnH for your help!!!Much appreciated!
Hello JohnH,
If I pass the same cookieContainer to my 2nd HttpWebRequest, then am getting that internal server error: 500.
If I dont pass it in the request, I dont get an error but I dont the csv file in the response.
Thanks.
Thanks JohnH.
I was playing around with my code and modified my code yesterday as per following. And finally it did work.I was able to download about 0.5 MB of csv file from the website using this program.
(I also saw a "Welcome page" response in the htmlResponse variable while debugging.)...
Hello,
Using C# 4.5,I'm trying to programmatically log-on to a third-party website and then download a csv file from another page on that site. I tried using following approach.I dont get any errors but it seems to download the contents of their logon page itself and save it as a csv file...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.