From a558e7c87a193056eb3d920915b8cd954debd227 Mon Sep 17 00:00:00 2001 From: E99p1ant Date: Wed, 13 Dec 2023 02:17:01 +0800 Subject: [PATCH] question(page): fix file md5 --- route/question/page.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/question/page.go b/route/question/page.go index 28216ff..20fd46b 100644 --- a/route/question/page.go +++ b/route/question/page.go @@ -266,7 +266,6 @@ func uploadImage(ctx context.Context, opts uploadImageOptions) error { hasher := md5.New() reader := io.TeeReader(uploadImageFile, hasher) - fileMd5 := fmt.Sprintf("%x", hasher.Sum(nil)) backupImageBuffer := bytes.Buffer{} uploadReader := io.TeeReader(reader, &backupImageBuffer) @@ -280,6 +279,7 @@ func uploadImage(ctx context.Context, opts uploadImageOptions) error { publicURLs := map[string]string{ shareServerName: publicURL, } + fileMd5 := fmt.Sprintf("%x", hasher.Sum(nil)) // Backup file. go func() {