From dfbeadacc42de150fba317bfe30fc7c13c6728b0 Mon Sep 17 00:00:00 2001 From: csznet Date: Tue, 5 Mar 2024 11:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E5=B8=A6=E7=A9=BA=E6=A0=BC=E6=97=A0=E6=B3=95=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/control.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/control/control.go b/control/control.go index 210e3b6..abdf522 100644 --- a/control/control.go +++ b/control/control.go @@ -15,7 +15,7 @@ import ( "csz.net/tgstate/utils" ) -// UploadImageAPI 上传文件api +// UploadImageAPI 上传图片api func UploadImageAPI(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") if r.Method == http.MethodPost { @@ -114,7 +114,7 @@ func D(w http.ResponseWriter, r *http.Request) { // 输出文件内容到控制台 if string(buffer[:12]) == "tgstate-blob" { content := string(buffer) - lines := strings.Fields(content) + lines := strings.Split(content, "\n") log.Println("分块文件:" + lines[1]) w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("Content-Disposition", "attachment; filename=\""+lines[1]+"\"")