# 'DownloadFileDestination' is not a member type of class 'Alamofire.DownloadRequest'

**URL:** <https://forums.swift.org/t/downloadfiledestination-is-not-a-member-type-of-class-alamofire-downloadrequest/60994>\
**Category:** Alamofire\
**Created:** [October 24, 2022, 3:40am UTC](https://forums.swift.org/t/downloadfiledestination-is-not-a-member-type-of-class-alamofire-downloadrequest/60994 "2022-10-24T03:40:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemisferaketiga](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@hemisferaketiga](https://forums.swift.org/u/hemisferaketiga)\
**Post date:** [October 24, 2022, 3:40am UTC](https://forums.swift.org/t/downloadfiledestination-is-not-a-member-type-of-class-alamofire-downloadrequest/60994/1 "2022-10-24T03:40:31Z")

</div>

Hi, I new to iOS dev and swift/alamofire..  
Currently I need to update our app, but when try to run using emulator, got error as below

"'DownloadFileDestination' is not a member type of class 'Alamofire.DownloadRequest'"

Below is the code.  
let destination: DownloadRequest.DownloadFileDestination = { \_, \_ in  
let directoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]  
let file = directoryURL.appendingPathComponent(saveUrl, isDirectory: false)  
return (file, [.createIntermediateDirectories, .removePreviousFile])  
}

Im have google and try several answer, but still not success.

Thanks

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [October 24, 2022, 4:08am UTC](https://forums.swift.org/t/downloadfiledestination-is-not-a-member-type-of-class-alamofire-downloadrequest/60994/2 "2022-10-24T04:08:19Z")

</div>

Seems you've got some outdated example code. `DownloadRequest.DownloadFileDestionation` is `DownloadRequest.Destination` as of Alamofire 5. I suggest you read [our documentation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#using-alamofire) to get started.

---

<div class="post-metadata">

**Author:** ![hemisferaketiga](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@hemisferaketiga](https://forums.swift.org/u/hemisferaketiga)\
**Post date:** [October 24, 2022, 4:20am UTC](https://forums.swift.org/t/downloadfiledestination-is-not-a-member-type-of-class-alamofire-downloadrequest/60994/3 "2022-10-24T04:20:34Z")

</div>

Thanks for your prompt reply sir.

I have the changes as image below.

 ![Screenshot 2022-10-24 at 12.14.04 PM](https://global.discourse-cdn.com/swift/original/3X/c/2/c260d5fa3f45020f66c6d8b1b68fe4bdaa5e3fb8.png)

before this I'm using

var manager: SessionManager?

manager?.download(downloadUrl, method: method, to: destination)  
.response { response in

is it correct to update to below? (manager?.download to AF.download)

AF.download(downloadUrl, to: destination).response { response in

TQ
