Basic Examples (3)
Download a file asynchronously while showing dynamic progress of the download:
Specify a file name:
Check the size of the download:
Display a bandwidth plot during the download:
Scope (5)
The output of MonitoredDownload is an Association:
Get the download file from MonitoredDownload:
Build a URL from components:
Download using an HTTPRequest:
Give a list of parameters:
Options (21)
IncludePlot (2)
Show real-time bandwidth use for the download by setting "IncludePlot"→True:
Use a more light-weight progress panel by disabling the bandwidth plot:
ExpectedFileHash (2)
If the MD5 hash of the remote file is known, MonitoredDownload can automatically verify the integrity of the download when completed:
An incorrect file hash will lead to a warning:
DeleteOnHashFailure (2)
Automatically delete the downloaded file if it fails to match a given expected file hash:
Verify that the file has been cleaned up:
CookieFunction (1)
Apply a function when cookies are set:
OverwriteTarget (2)
By default, the one-argument form of MonitoredDownload attempts to automatically name the destination file so as not to conflict with existing files:
Overwrite any existing file instead:
Using the second argument of MonitoredDownload overrides any settings for OverwriteTarget:
The file has been overwritten:
KeepPanelOpen (4)
By default, the progress panel is automatically removed when the download completes:
Keep the panel open instead:
When using "KeepPanelOpen"→True, the panel will persist in its current state even if the Cancel button is pressed:
Once canceled, the panel becomes static with no dynamic content:
Compare to the cell prior to an abort:
ShowPanel (1)
Use "ShowPanel"→False if you don’t want to display any progress panel:
Asynchronous (3)
By default, files are downloaded asynchronously, so the output of MonitoredDownload returns quickly:
Use Asynchronous→False to wait for the download to finish before returning a value:
Downloading synchronously allows you to use the resulting file without needing to check if the download has completed:
FinishedDownloadHandler (2)
Apply a function to the downloaded file once the download completes:
Download a notebook asynchronously and open it when ready:
OpenWhenFinished (2)
During a download, the "Open When Finished" checkbox can be used to automatically evaluate SystemOpen on the completed file when ready:
Alternatively, this setting can be made programmatically using the "OpenWhenFinished" option:
Applications (3)
MonitoredDownload can asynchronously download large files. Here is a large test file full of random bytes:
Start the download:
The current kernel is still available while the download is in progress:
Properties and Relations (6)
Automatic File Naming (6)
When only using the one-argument form, MonitoredDownload attempts to automatically choose sensible filenames based on the MIMEType:
Automatically named files will be placed in the current directory:
Changing the current directory with SetDirectory will also change where the file is saved:
For cloud objects, the file name can be determined even if it’s in UUID form:
When file names are determined automatically, numbering will be used to avoid conflicts:
Using OverwriteTarget→True will use the base chosen filename (without numbering), and overwrite the existing file if necessary: