<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSFileManagerResumeSyncBehavior/afterUploadWithFailOnConflict",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSFileManagerResumeSyncBehavior@NSFileManagerResumeSyncBehaviorAfterUploadWithFailOnConflict"
  },
  "title" : "NSFileManagerResumeSyncBehavior.afterUploadWithFailOnConflict"
}
-->

# NSFileManagerResumeSyncBehavior.afterUploadWithFailOnConflict

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

```
case afterUploadWithFailOnConflict
```

## Discussion

If the upload succeeds, the sync resumes with the [`NSFileManagerResumeSyncBehavior.preserveLocalChanges`](/documentation/Foundation/NSFileManagerResumeSyncBehavior/preserveLocalChanges) behavior.

If the provider detects a conflict, the upload fails with an  [`NSFileWriteUnknownError`](/documentation/Foundation/NSFileWriteUnknownError-c.enum.case), with the underlying error of <doc://com.apple.documentation/documentation/FileProvider/NSFileProviderError/localVersionConflictingWithServer>.
In this case, the app needs to call [`fetchLatestRemoteVersionOfItem(at:completionHandler:)`](/documentation/Foundation/FileManager/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`](/documentation/Foundation/URLResourceKey/ubiquitousItemSupportedSyncControlsKey) URL resource and verify that [`failUploadOnConflict`](/documentation/Foundation/NSFileManagerSupportedSyncControls/failUploadOnConflict) is `true`.

---

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)