---
title: "filePromiseProvider(_:fileNameForType:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsfilepromiseproviderdelegate/filepromiseprovider(_:filenamefortype:)"
---

# filePromiseProvider(_:fileNameForType:)

Provides the drag destination file’s name.

## Declaration

```swift
@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

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.

## See Also

### Handling File Promises

- [filePromiseProvider(_:writePromiseTo:completionHandler:)](appkit/nsfilepromiseproviderdelegate/filepromiseprovider(_:writepromiseto:completionhandler:).md)
- [operationQueue(for:)](appkit/nsfilepromiseproviderdelegate/operationqueue(for:).md)
