We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MacOS 10.15: Swift version - 5.1.1-dev
Ubuntu 18.04: Swift version - 5.2-dev
md5: ec39e828733ecb8c8d2b83067fba2c43
is duplicated by:
Issue Description:
Using the `URL` and Data classes, I'm trying to download a zip file from GitHub using the following code:
import Foundation import FoundationNetworking let url = URL(string: "https://github.com/brendenlake/omniglot/raw/master/python/images_background_small1.zip")! let file = try Data(contentsOf: url) file.write(to: URL(fileURLWithPath: "~/test.zip"))
On MacOS, this runs just fine(returns 1319022 bytes), while on Ubuntu 18, around 160 bytes is only downloaded, resulting in an incomplete download.
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
This is due to a 302 redirect not being followed, and has been fixed in the master branch.
master
$ cat sr-12439.swift import Foundation #if canImport(FoundationNetworking) import FoundationNetworking #endif let url = URL(string: "https://github.com/brendenlake/omniglot/raw/master/python/images_background_small1.zip")! let file = try Data(contentsOf: url) print("Read \(file.count) bytes") try! file.write(to: URL(fileURLWithPath: "test.zip")) $ ~/swift-DEVELOPMENT-SNAPSHOT-2020-05-03-a-ubuntu18.04/usr/bin/swift sr-12439.swift Read 1319022 bytes $ ls -l test.zip -rw------- 1 501 dialout 1319022 May 4 23:28 test.zip $
No branches or pull requests
Environment
MacOS 10.15: Swift version - 5.1.1-dev
Ubuntu 18.04: Swift version - 5.2-dev
Additional Detail from JIRA
md5: ec39e828733ecb8c8d2b83067fba2c43
is duplicated by:
Issue Description:
Using the `URL` and Data classes, I'm trying to download a zip file from GitHub using the following code:
On MacOS, this runs just fine(returns 1319022 bytes), while on Ubuntu 18, around 160 bytes is only downloaded, resulting in an incomplete download.
The text was updated successfully, but these errors were encountered: