---
title: "suggestedFileName(_:)"
framework: coretransferable
role: symbol
role_heading: Instance Method
path: "coretransferable/transferrepresentation/suggestedfilename(_:)-47rg0"
---

# suggestedFileName(_:)

Provides a filename to use if the receiver chooses to write the item to disk.

## Declaration

```swift
func suggestedFileName(_ fileName: @escaping @Sendable (Self.Item) -> String?) -> some TransferRepresentation<Self.Item>

```

## Parameters

- `fileName`: The optional closure that returns the suggested filename including the filename extension. If several suggested file names are specified on an item, only the last one will be used.

## Discussion

Discussion Any transfer representation can be written to disk. struct Note: Transferable {     var title: String     var body: String     static var transferRepresentation: some TransferRepresentation {         ProxyRepresentation(exporting: \.body)             .suggestedFileName { $0.title + ".txt" }      }  }
