<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreTransferable",
  "identifier" : "/documentation/CoreTransferable/TransferRepresentation/suggestedFileName(_:)-2yln2",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Transferable",
      "CoreTransferable"
    ],
    "preciseIdentifier" : "s:16CoreTransferable22TransferRepresentationPAAE17suggestedFileNameyQrSSF"
  },
  "title" : "suggestedFileName(_:)"
}
-->

# suggestedFileName(_:)

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

```
func suggestedFileName(_ fileName: String) -> some TransferRepresentation<Self.Item>
```

## Parameters

`fileName`

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

Any transfer representation can be written to disk.

```
 extension ImageDocumentLayer: Transferable {
     static var transferRepresentation: some TransferRepresentation {
         DataRepresentation(contentType: .layer) { layer in
             layer.data()
             } importing: { data in
                 try ImageDocumentLayer(data: data)
             }
             .suggestedFileName("Layer.exampleLayer")
         DataRepresentation(exportedContentType: .png) { layer in
             layer.pngData()
         }
         .suggestedFileName("Layer")
     }
 }
```

The .exampleLayer filename extension above should match
the extension for the `layer` content type,
which you declare in your app’s `Info.plist` file.

---

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)