From 43a36b3701ad0279da91999b96e275dc6e459b0f Mon Sep 17 00:00:00 2001 From: zicla Date: Mon, 23 Jul 2018 21:31:31 +0800 Subject: [PATCH] Remove the tmp things. --- rest/matter_service.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rest/matter_service.go b/rest/matter_service.go index 5f8f4b8..8f1ce5d 100644 --- a/rest/matter_service.go +++ b/rest/matter_service.go @@ -207,14 +207,10 @@ func (this *MatterService) Crawl(url string, filename string, user *User, puuid //使用临时文件存放 fmt.Printf("存放于%s", absolutePath) - size, err := this.httpDownloadFile(absolutePath+".tmp", url) + size, err := this.httpDownloadFile(absolutePath, url) this.PanicError(err) - //完成了之后重命名 - err = os.Rename(absolutePath+".tmp", absolutePath) - this.PanicError(err) - - //TODO:判断用户自身上传大小的限制。 + //判断用户自身上传大小的限制。 if user.SizeLimit >= 0 { if size > user.SizeLimit { panic("您最大只能上传" + HumanFileSize(user.SizeLimit) + "的文件")