---
title: "export(to:as:isolation:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetexportsession/export(to:as:isolation:)"
---

# export(to:as:isolation:)

Exports the asset to the output location in the specified file type.

## Declaration

```swift
@backDeployed(before: macOS 26.0, iOS 26.0, tvOS 26.0, visionOS 26.0)
final func export(to url: URL, as fileType: AVFileType, isolation: isolated (any Actor)? = #isolation) async throws
```

## Parameters

- `url`: An output location to write the exported media. You can use the doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-swift.struct/preferredFilenameExtension property of doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-swift.struct to determine an appropriate file extension for the specified file type.
- `fileType`: The type of file for the session to write.
- `isolation`: The isolation context.

## Discussion

Discussion This method throws an error if you cancel the export or you specify a file type value that isn’t contained in the session’s supportedFileTypes. You can monitor the status of an export by calling the states(updateInterval:) method. note: You can cancel an in-progress export by calling cancel() on the Task or parent task that initiated the operation.

## See Also

### Exporting media

- [cancelExport()](avfoundation/avassetexportsession/cancelexport().md)
- [exportAsynchronously(completionHandler:)](avfoundation/avassetexportsession/exportasynchronously(completionhandler:).md)
