hsun 1 year ago
parent
commit
a67d968b2c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      controllers/resource.go

+ 8 - 0
controllers/resource.go

@@ -252,6 +252,10 @@ func (this *ResourceController) VideoUpload() {
 	//savePath := utils.Upload_Audio_Dir + time.Now().Format("200601/20060102/")
 	//savePath += fileName
 
+	defer func() {
+		_ = os.Remove(fpath)
+	}()
+
 	//上传到阿里云 和 minio
 	resourceUrl := ``
 	//if utils.ObjectStorageClient == "minio" {
@@ -439,6 +443,10 @@ func (this *ResourceController) VoiceUpload() {
 	utils.FileLog.Info("start update oss ")
 	utils.FileLog.Info(fmt.Sprintf("%s:", time.Now().Format(utils.FormatDateTime)))
 
+	defer func() {
+		_ = os.Remove(fpath)
+	}()
+
 	//savePath := utils.Upload_Audio_Dir + time.Now().Format("200601/20060102/")
 	//savePath += fileName
 	//上传到阿里云 和 minio