Skip to content
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

下截文件为0KB #1

Open
xxxlzj520 opened this issue Nov 19, 2020 · 0 comments
Open

下截文件为0KB #1

xxxlzj520 opened this issue Nov 19, 2020 · 0 comments

Comments

@xxxlzj520
Copy link

github.com/bzsome/ChaoGoDown v0.0.0-20200521160346-39c1fa9bbae0

使用你的例子下载,文件为0KB
request := &chaoDown.Request{
Method: "get",
URL: "https://github.com/alibaba/nacos/releases/download/1.2.1/nacos-server-1.2.1.tar.gz",
Header: map[string]string{
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
},
}
download := &chaoDown.Downloader{
PoolSize: 100,
//ChuckSize: 1024 * 100,
Path: "",
FileName: "nacos-server-1.2.1.tar.gz",
}

err := download.Down(request)
if err != nil {
	fmt.Println(err)
} else {
	time := download.GetExeTime()
	fmt.Printf("下载用时:%.2f 秒,保存路径:%s", time.Seconds(), download.GetSavePath())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant