I am trying to "download" a file using the AxWebbrowser in VB.Net language (though, the answer could be in C#, I don't matter). The browser is already logged in, so I tried to catch the download, but for now the test is done with a PDF and I think it is opened directly in the browser. OK, lets put you in the context.
- AxWebbrowser going to a login page which I use JavaScript to fill it and continue
- Navigating to a message page which includes links to attached files
- Trying to download these files (in fact, trying to get their bytes to transform them in Base64 and include them in my HTML returned... so now the only problem is getting the bytes, after that, conversion + inclusion is something I know)
So, I tried to pass to the browser the URL directly and detect the download and catch the bytes ==> Not able to.
I tried to use a WebClient
which I set the cookies, but it doesn't work. Though, using this and comparing with Chrome, I see the cookies aren't the same (in fact I can highly presume there is one important missing).
So, either why I don't get all the cookies or how could I get the bytes from these files?