Component: WebDownloadDelegate 
-------------------------------

Allow controlled downloads on macOS webviewer.

Normally FileMaker ignores downloads. Using plugin classes you can allow downloads and get a script triggered when download completes.  
For WebKit 1 and 2.

| Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|
| [2.7](newinversion27.md "First functions introduced with version 2.7.") / [2.8](newinversion28.md "Newest functions in version 2.8.") | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

  
| Item | Details |
|:--|:--|
| [WebDownloadDelegate.Cancel](WebDownloadDelegateCancel.md)   Cancels download. | Mac/iOS   2.7 |
| [WebDownloadDelegate.ClearBeginDownloadHandler](WebDownloadDelegateClearBeginDownloadHandler.md)   Clears the script called for beginning downloads. | Mac/iOS   2.7 |
| [WebDownloadDelegate.ClearDidDownloadHandler](WebDownloadDelegateClearDidDownloadHandler.md)   Clears the script called for finished downloads. | Mac/iOS   2.7 |
| [WebDownloadDelegate.ClearFailHandler](WebDownloadDelegateClearFailHandler.md)   Clears the script called for failed downloads. | Mac/iOS   2.7 |
| [WebDownloadDelegate.ClearFolder](WebDownloadDelegateClearFolder.md)   Clears the download folder. | Mac/iOS   2.8 |
| [WebDownloadDelegate.ClearProgressHandler](WebDownloadDelegateClearProgressHandler.md)   Clears the script called for download progress. | Mac/iOS   2.7 |
| [WebDownloadDelegate.DownloadedLength](WebDownloadDelegateDownloadedLength.md)   Number of bytes downloaded so far. | Mac/iOS   2.7 |
| [WebDownloadDelegate.ErrorMessage](WebDownloadDelegateErrorMessage.md)   The last error message from download. | Mac/iOS   2.7 |
| [WebDownloadDelegate.GetFolder](WebDownloadDelegateGetFolder.md)   Queries current defined download folder. | Mac/iOS   2.8 |
| [WebDownloadDelegate.Install](WebDownloadDelegateInstall.md)   Assigns this web viewer our download delegate. | Mac/iOS   2.7 |
| [WebDownloadDelegate.MIMEType](WebDownloadDelegateMIMEType.md)   Returns the MIME type. | Mac/iOS   2.7 |
| [WebDownloadDelegate.Path](WebDownloadDelegatePath.md)   The file path of the downloaded file. | Mac/iOS   2.7 |
| [WebDownloadDelegate.SetBeginDownloadHandler](WebDownloadDelegateSetBeginDownloadHandler.md)   Sets the script called when a download is about to begin. | Mac/iOS   2.7 |
| [WebDownloadDelegate.SetDidDownloadHandler](WebDownloadDelegateSetDidDownloadHandler.md)   Sets the script called when a download finished. | Mac/iOS   2.7 |
| [WebDownloadDelegate.SetFailHandler](WebDownloadDelegateSetFailHandler.md)   Sets the script called when a download failed. | Mac/iOS   2.7 |
| [WebDownloadDelegate.SetFolder](WebDownloadDelegateSetFolder.md)   Sets the download folder. | Mac/iOS   2.8 |
| [WebDownloadDelegate.SetProgressHandler](WebDownloadDelegateSetProgressHandler.md)   Sets the script called when a download made progress. | Mac/iOS   2.7 |
| [WebDownloadDelegate.URL](WebDownloadDelegateURL.md)   Queries current URL. | Mac/iOS   2.7 |
| [WebDownloadDelegate.expectedContentLength](WebDownloadDelegateexpectedContentLength.md)   Returns the expected content length. | Mac/iOS   2.7 |
| [WebDownloadDelegate.suggestedFilename](WebDownloadDelegatesuggestedFilename.md)   Returns a suggested filename. | Mac/iOS   2.7 |
| [WebDownloadDelegate.textEncodingName](WebDownloadDelegatetextEncodingName.md)   Returns the name of the receiver's text encoding provided by the response's originating source. | Mac/iOS   2.7 |

21 functions shown.

### Release notes

- **Version 13.4**
    - Upgraded [WebDownloadDelegate](https://www.mbsplugins.eu/component_WebDownloadDelegate.shtml) functions to work on WebKit 2.0 on macOS and iOS.
- **Version 11.0**
    - Fixed an issue with [WebDownloadDelegate.SetBeginDownloadHandler](https://www.mbsplugins.eu/WebDownloadDelegateSetBeginDownloadHandler.shtml) not calling the script.
- **Version 9.5**
    - Added check for [WebDownloadDelegate.SetFolder](http://www.mbsplugins.eu/WebDownloadDelegateSetFolder.shtml) to verify path is a valid folder.

### Blog Entries

- [Neues MBS Plugin 13.4 für Claris FileMaker](https://www.mbsplugins.de/archive/2023-09-12/Neues_MBS_Plugin_134_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.4 for Claris FileMaker - More than 7100 Functions In One Plugin](https://www.mbsplugins.de/archive/2023-09-12/MBS_Plugin_134_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Web Download Delegate for WebKit 2 in FileMaker](https://www.mbsplugins.de/archive/2023-08-29/Web_Download_Delegate_for_WebK/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.4pr5](https://www.mbsplugins.de/archive/2023-08-28/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### Example Databases

- [WebViewer/WebViewer Download Delegate for Mac](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Download%20Delegate%20for%20Mac.shtml#1ScriptAnchor_)

[HTML Version](component_WebDownloadDelegate.shtml)