Difference between revisions of "ISDBUI::DownloadFile"

From MediaMonkey Wiki
Jump to: navigation, search
(Method description)
 
Line 1: Line 1:
{{MethodDeclaration|SDBDownloader|ISDBDownloader|Method DownloadFile( URL As String, FileName As String, AddToLibrary As Boolean)}}
 
  
===Parameters===
 
 
{{MethodParameters
 
|URL |String |URL of the content to be downloaded
 
|FileName |String | Specifies where to download the file, if this parameter is empty then the default download location specified in Options is used
 
|AddToLibrary | Boolean | If this parameter is TRUE then the downloaded track will be added to MediaMonkey library
 
}}
 
 
===Method description===
 
 
Initializes download of a file on the background.
 
 
To manipulate with the initialized download and for getting download progress use the others methods of [[SDBDownloader]] class.
 
If you want to get an URL content directly to String then use [[SDBDownloader::GetURLContent]]
 
 
Added in MediaMonkey 4.0
 
 
===Example code===                   
 
<source lang="vb">
 
 
Option Explicit
 
 
Dim UI  : Set UI = SDB.UI
 
 
Sub OnStartUp()
 
    Dim mnuTest
 
 
    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
 
    mnuTest.Caption = SDB.Localize("Download Script")
 
    mnuTest.OnClickFunc = "SDBOnClick"
 
    mnuTest.UseScript = Script.ScriptPath
 
   
 
    Script.RegisterEvent SDB, "OnDownloadFinished", "SDBDownloadFinished"
 
End Sub
 
 
Sub SDBDownloadFinished( URL)
 
    MsgBox("Download has finished for the URL:"&URL)
 
End Sub
 
 
 
Sub SDBOnClick(Item) 
 
  SDB.Downloader.DownloadFile "http://www.spiker.wz.cz/SecretStream.mp3", "C:\aaa.mp3", false 
 
End Sub
 
 
</source>
 
 
===Related Topics===
 
 
[[Category:Scripting|{{PAGENAME}}]]
 
[[Category:Automation objects|{{PAGENAME}}]]
 
[[Category:CoClass SDBDownloader|{{PAGENAME}}]]
 
[[Category:Interface ISDBDownloader|{{PAGENAME}}]]
 

Latest revision as of 09:06, 8 June 2010