Hope you are doing good.
My requirement is to download some files from a site which requires login, password. I am able to navigate through all the way to the file generation page.(using .Net webBrowser control). I am stuck at file save dialog. I want to skip it but unable to do so as the there is no direct link to the file to be downloaded. A function is called and the file is created on the fly.
I am considering to use something else than webBrowser. Please guide me, if webkit also shows the same file dialog? Is there a respectively easier way to skip that using webKit?
I am using .Net 4.5 and windows 7 32 bit.
What i have already tried:
SendKeys.WaitSend("{Enter}")
Result: Enter is sent to the webbrowser control, not to the file download dialog. I have tried to get the process of the file dialog. But Process "WindowsFormsApplication.vshost"** doesn't have any child processes.
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
WebClient client = new WebClient();
client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(client_DownloadDataCompleted);
client.DownloadDataAsync(e.Url);
Result: e.URL has no direct link. On clicking the file for download, a function is called at back-end. I have seen in Firefox the code inside that function, which is just this one line:
document.location.href = 'something.do?something='+variable1+'&something='+variable2+ '&something=' + variable3;
Investigating above, i am able to call that function directly by pasting the following line in browser.(in case my session has not expired):
and what i see next is a dialog box asking save/open/cancel.
Thank You, Regards