suggestedFilename
A suggested filename for the response data.
Declaration
var suggestedFilename: String? { get }Discussion
Accessing this property attempts to generate a filename using the following information, 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 property appends the proper file extension based on the MIME type. Accessing this property always returns a valid filename regardless of whether the resource is saved to disk.