Antwise community forums

Full Version: Download images directly?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The jpg file opened by the address is displayed.
Save that file to a specific folder on your computer with a specific file name.
Is there a way to download+save immediately?

ex) ==> c:\myimage\test777.jpg

Yes you can download any type of file that you want.

If you have the URL’s of the files you want to download then the following example might help.
Say you have a button Download and you use the NavigateWithWebResourceRequest method to directly download the file as a “GET” request.
Private Sub DownloadButton_Click()
  Dim URL As String
  URL = ""
 EdgeWebBrowser.NavigateWithWebResourceRequest URL, "GET", "", ""
End Sub
And then in the AntView object you can handle the request like so:
Private Sub EdgeWebBrowser_OnDownloadStarting(Cancel As Boolean, Handled As Boolean, ByVal DownloadOperation As AntViewAx.IAntViewDownloadOperation, ResultPath As String, ResultFileName As String)
  Handled = True
  ResultPath = "C:\Zips\"
  ResultFileName = ""
End Sub
This assumes that you have a folder named “C:\Zips” for storing the downloaded files, so adjust that to your needs.

Hope this helps,