WebDownloadDelegate.suggestedFilename
-------------------------------------

Returns a suggested filename.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebDownloadDelegate](component_WebDownloadDelegate.md) | [2.7](newinversion27.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "WebDownloadDelegate.suggestedFilename" ) ### Parameters

none

### Result

Returns a suggested filename.

### Description

Returns a suggested filename.  
The method tries to create a filename using the following, in order:  
  
- A filename specified using the content disposition header.
- The last path component of the URL.
- The host of the URL.

If the host of URL can't be converted to a valid filename, the filename "unknown" is used.  
  
In most cases, this method appends the proper file extension based on the MIME type. This method will always return a valid filename regardless of whether or not the resource is saved to disk.  
### Example Databases

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

This function is free to use.

Created 18th August 2014 , last changed 26th August 2023

  
[WebDownloadDelegate.expectedContentLength](WebDownloadDelegateexpectedContentLength.md) - [WebDownloadDelegate.textEncodingName](WebDownloadDelegatetextEncodingName.md)

[HTML Version](WebDownloadDelegatesuggestedFilename.shtml)