---
title: IntentFile
framework: appintents
role: symbol
role_heading: Structure
path: appintents/intentfile
---

# IntentFile

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

## Declaration

```swift
struct IntentFile
```

## Mentioned in

Adding parameters to an app intent Defining app entities for your custom data types

## Overview

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:)](appintents/intentfile/init(data:filename:type:).md)
- [init(fileURL:filename:type:)](appintents/intentfile/init(fileurl:filename:type:).md)

### Getting the file information

- [filename](appintents/intentfile/filename.md)
- [fileURL](appintents/intentfile/fileurl.md)
- [type](appintents/intentfile/type.md)
- [data](appintents/intentfile/data.md)
- [removedOnCompletion](appintents/intentfile/removedoncompletion.md)

### Instance Properties

- [availableContentTypes](appintents/intentfile/availablecontenttypes.md)

### Instance Methods

- [data(contentType:)](appintents/intentfile/data(contenttype:).md)
- [file(contentType:destinationDirectory:)](appintents/intentfile/file(contenttype:destinationdirectory:).md)
- [withFile(contentType:allowOpenInPlace:fileHandler:)](appintents/intentfile/withfile(contenttype:allowopeninplace:filehandler:).md)

### Type Aliases

- [IntentFile.Specification](appintents/intentfile/specification.md)
- [IntentFile.UnwrappedType](appintents/intentfile/unwrappedtype.md)
- [IntentFile.ValueType](appintents/intentfile/valuetype.md)

### Type Properties

- [defaultResolverSpecification](appintents/intentfile/defaultresolverspecification.md)

### Enumerations

- [IntentFile.IntentFileError](appintents/intentfile/intentfileerror.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomLocalizedStringResourceConvertible](foundation/customlocalizedstringresourceconvertible.md)
- [Decodable](swift/decodable.md)
- [DisplayRepresentable](appintents/displayrepresentable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [InstanceDisplayRepresentable](appintents/instancedisplayrepresentable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [TypeDisplayRepresentable](appintents/typedisplayrepresentable.md)
