<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/IntentFile",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents10IntentFileV"
  },
  "title" : "IntentFile"
}
-->

# IntentFile

An interface for providing an app entity that represents an on-disk file or file-based resource.

```
struct IntentFile
```

## Overview

Provide an intent file entity implementation to describe data you store in a file on disk or in memory by providing its
associated name and uniform type identifier.

## Topics

### Creating a file

[`init(data:filename:type:)`](/documentation/AppIntents/IntentFile/init(data:filename:type:))

[`init(fileURL:filename:type:)`](/documentation/AppIntents/IntentFile/init(fileURL:filename:type:))

### Getting the file information

[`filename`](/documentation/AppIntents/IntentFile/filename)

The human-readable name of the file, which will be displayed to the user.

[`fileURL`](/documentation/AppIntents/IntentFile/fileURL)

URL to the file on disk, if any.
If the file isn’t stored on disk, access the contents using the `data` property.

[`type`](/documentation/AppIntents/IntentFile/type)

The uniform type identifier of the file. (i.e. “public.json”, “public.png”, or any custom type)
More information about uniform type identifiers can be found in <CoreServices/UTCoreTypes.h>

[`data`](/documentation/AppIntents/IntentFile/data)

The contents of the file.
If the file was created with a URL, accessing this property will memory map the file contents.

[`removedOnCompletion`](/documentation/AppIntents/IntentFile/removedOnCompletion)

Indicates whether the file should be automatically deleted from disk when the Shortcut is
done running. `false` by default.



---

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)