<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionDownloadDelegate/urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSURLSessionDownloadDelegate(im)URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"
  },
  "title" : "urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)"
}
-->

# urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)

Tells the delegate that the download task has resumed downloading.

```
optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64)
```

## Parameters

`session`

The session containing the download task that finished.

`downloadTask`

The download task that resumed. See explanation in the discussion.

`fileOffset`

If the file’s cache policy or last modified date prevents reuse of the existing content, then this value is zero. Otherwise, this value is an integer representing the number of bytes on disk that do not need to be retrieved again.
  
  > Note:
  > In some situations, it may be possible for the transfer to resume earlier in the file than where the previous transfer ended.

`expectedTotalBytes`

The expected length of the file, as provided by the `Content-Length` header. If this header was not provided, the value is [`NSURLSessionTransferSizeUnknown`](/documentation/Foundation/NSURLSessionTransferSizeUnknown).

## Discussion

If a resumable download task is canceled or fails, you can request a `resumeData` object that provides enough information to restart the download in the future. Later, you can call [`downloadTask(withResumeData:)`](/documentation/Foundation/URLSession/downloadTask(withResumeData:)) or [`downloadTask(withResumeData:completionHandler:)`](/documentation/Foundation/URLSession/downloadTask(withResumeData:completionHandler:)) with that data.

When you call those methods, you get a new download task. As soon as you resume that task, the session calls this method with that new task to indicate that the download is resumed.

---

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)