---
title: NSFileManagerResumeSyncBehavior.afterUploadWithFailOnConflict
framework: foundation
role: symbol
role_heading: Case
path: foundation/nsfilemanagerresumesyncbehavior/afteruploadwithfailonconflict
---

# NSFileManagerResumeSyncBehavior.afterUploadWithFailOnConflict

Resumes sync by first uploading the local version of the file, failing if the provider detects a conflict.

## Declaration

```swift
case afterUploadWithFailOnConflict
```

## Discussion

Discussion If the upload succeeds, the sync resumes with the NSFileManagerResumeSyncBehavior.preserveLocalChanges behavior. If the provider detects a conflict, the upload fails with an  NSFileWriteUnknownError, with the underlying error of localVersionConflictingWithServer. In this case, the app needs to call fetchLatestRemoteVersionOfItem(at:completionHandler:), rebase local changes on top of the newly fetched version to resolve the conflict, and try again to resume sync. This scenario is only available on paused items for which the file provider supports the fail-on-conflict behavior. To check that the file provider supports the behavior, get the ubiquitousItemSupportedSyncControlsKey URL resource and verify that failUploadOnConflict is true.

## See Also

### Identifying sync behaviors

- [NSFileManagerResumeSyncBehavior.preserveLocalChanges](foundation/nsfilemanagerresumesyncbehavior/preservelocalchanges.md)
- [NSFileManagerResumeSyncBehavior.dropLocalChanges](foundation/nsfilemanagerresumesyncbehavior/droplocalchanges.md)
