<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSFilePromiseProviderDelegate/filePromiseProvider(_:fileNameForType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFilePromiseProviderDelegate(im)filePromiseProvider:fileNameForType:"
  },
  "title" : "filePromiseProvider(_:fileNameForType:)"
}
-->

# filePromiseProvider(_:fileNameForType:)

Provides the drag destination file’s name.

```
@MainActor func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, fileNameForType fileType: String) -> String
```

## Parameters

`filePromiseProvider`

The file promise provider.

`fileType`

A string describing the type of file being provided.

## Discussion

This method is called when the drag destination fulfills the file promise. Determine and return the final filename (a base filename, not a full path).

> Note:
> Don’t start writing the file to the destination directory until the drag process is complete.  The drag process stops to wait for the method to return, and if it has to wait too long, the drag could be canceled.

---

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)