<!--
{
  "availability" : [
    "macOS: 10.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURLDownloadDelegate/download(_:shouldDecodeSourceDataOfMIMEType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSURLDownloadDelegate(im)download:shouldDecodeSourceDataOfMIMEType:"
  },
  "title" : "download(_:shouldDecodeSourceDataOfMIMEType:)"
}
-->

# download(_:shouldDecodeSourceDataOfMIMEType:)

Sent when a download object determines that the downloaded file is encoded to inquire whether the file should be automatically decoded.

```
optional func download(_ download: NSURLDownload, shouldDecodeSourceDataOfMIMEType encodingType: String) -> Bool
```

## Parameters

`download`

The URL download object sending the message.

`encodingType`

The type of encoding used by the downloaded file. The supported encoding formats are MacBinary (`"application/macbinary"`), Binhex (`"application/mac-binhex40"`) and gzip (`"application/gzip"`).

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to decode the file, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

The delegate may receive this message more than once if the file has been encoded multiple times. This method is not called if the downloaded file is not encoded.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)