Recently I wanted to automatically trigger and extract some backup files from a web application. Their smug support guy told me this wasn’t possible, so I started to throw together a little scraper to prove them wrong.
I ran across an issue when triggering the actual download of my backup file. A download file dialog displays by default, which is less than ideal. The documentation doesn’t do a great job of explaining how to override this behavior, so here’s a quick overview of what I did in VB.NET:
Pop this in with your import statements:
Add an event handler:
AddHandler WebCore.Download, AddressOf SkipDLPath
And then put something like this in your handler method:
Private Sub SkipDLPath(sender As Object, e As DownloadEventArgs) Dim DLPath as String = "C:\Backups\myBackup.zip" e.Handled = True e.SelectedFile = DLPath End Sub
The file chooser prompt should be suppressed and Awesomium will happily start downloading the file. I monitored the progress and completion using the DownloadItem class.