<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/IntentFile/data(contentType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents10IntentFileV4data11contentType10Foundation4DataV07UniformG11Identifiers6UTTypeV_tYaKF"
  },
  "title" : "data(contentType:)"
}
-->

# data(contentType:)

Requests an `IntentFile` representation as binary data of the requested content type if possible.

```
func data(contentType: UTType) async throws -> Data
```

## Parameters

`contentType`

A content type of the returned data.

## Discussion

If the `IntentFile` is backed by a file `URL`, this might cause loading the
entire file contents into memory.

---

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)