New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`.download` image and `responseData` doesn't work #1818

Closed
ded opened this Issue Dec 3, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@ded

ded commented Dec 3, 2016

I copied this verbatim from the main README and it doesn't work (using the following jpeg in the example).

Alamofire.download("https://static.preapp.co/medias/2016/11/10/3194-a7d7afbf22.jpg")
    .downloadProgress { progress in
        print("Download Progress: \(progress.fractionCompleted)")
    }
    .responseData { response in
        // response.result.value  is ALWAYS nil
        if let data = response.result.value {
            let image = UIImage(data: data)
        }
    }
@ded

This comment has been minimized.

Show comment
Hide comment
@ded

ded Dec 3, 2016

Didn't provide this information earlier.
I'm on Swift 3.0, using Xcode 8.1. Alamofire 4.2.0 (cocoapods)

ded commented Dec 3, 2016

Didn't provide this information earlier.
I'm on Swift 3.0, using Xcode 8.1. Alamofire 4.2.0 (cocoapods)

@Faisal-AlNeela

This comment has been minimized.

Show comment
Hide comment
@Faisal-AlNeela

Faisal-AlNeela Dec 7, 2016

I had the same problem
did you found a solution???

Faisal-AlNeela commented Dec 7, 2016

I had the same problem
did you found a solution???

@cnoon

This comment has been minimized.

Show comment
Hide comment
@cnoon

cnoon Dec 16, 2016

Member

You need to specify the destination closure. Otherwise the file isn't moved out of the temp directory and you don't have access to the data outside of your sandbox after the SessionDelegate API is called. See our README for more info.

I just pushed up ffaa071 which updates the README to hopefully make this more clear.

Cheers. 🍻

Member

cnoon commented Dec 16, 2016

You need to specify the destination closure. Otherwise the file isn't moved out of the temp directory and you don't have access to the data outside of your sandbox after the SessionDelegate API is called. See our README for more info.

I just pushed up ffaa071 which updates the README to hopefully make this more clear.

Cheers. 🍻

@cnoon cnoon closed this Dec 16, 2016

@cnoon cnoon added this to the 4.3.0 milestone Dec 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment