<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSession/uploadTask(withResumeData:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLSession(im)uploadTaskWithResumeData:"
  },
  "title" : "uploadTask(withResumeData:)"
}
-->

# uploadTask(withResumeData:)

Creates an upload task from a resume data blob. Requires the server to support the latest resumable uploads
Internet-Draft from the HTTP Working Group, found at
https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/
If resuming from an upload file, the file must still exist and be unmodified. If the upload cannot be successfully
resumed, URLSession:task:didCompleteWithError: will be called.

```
func uploadTask(withResumeData resumeData: Data) -> URLSessionUploadTask
```

## Parameters

`resumeData`

Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method.

## Return Value

A new session upload task, or nil if the resumeData is invalid.

---

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)