From 68a6a0c40e354bf0f305316f6108a49adb457767 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sun, 11 Sep 2022 17:04:05 +0800 Subject: [PATCH] fix(aliyundrive): upload empty file --- drivers/aliyundrive/driver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/aliyundrive/driver.go b/drivers/aliyundrive/driver.go index f0572792f7e..151eceaf7de 100644 --- a/drivers/aliyundrive/driver.go +++ b/drivers/aliyundrive/driver.go @@ -264,7 +264,9 @@ func (d *AliDrive) Put(ctx context.Context, dstDir model.Obj, stream model.FileS return err } res.Body.Close() - up(i * 100 / count) + if count > 0 { + up(i * 100 / count) + } } var resp2 base.Json _, err, e = d.request("https://api.aliyundrive.com/v2/file/complete", http.MethodPost, func(req *resty.Request) {