---
title: deletesFileUponFailure
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurldownload/deletesfileuponfailure
---

# deletesFileUponFailure

Returns whether the receiver deletes partially downloaded files when a download stops prematurely.

## Declaration

```swift
var deletesFileUponFailure: Bool { get set }
```

## Return Value

Return Value true if partially downloaded files should be deleted when a download stops prematurely, false otherwise. The default is true.

## See Also

### Resuming partial downloads

- [canResumeDownloadDecoded(withEncodingMIMEType:)](foundation/nsurldownload/canresumedownloaddecoded(withencodingmimetype:).md)
- [init(resumeData:delegate:path:)](foundation/nsurldownload/init(resumedata:delegate:path:).md)
- [resumeData](foundation/nsurldownload/resumedata.md)
