Kaynağa Gözat

Delete encrypted file post download

Neeraj Gupta 1 yıl önce
ebeveyn
işleme
fda7fe02a9
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      pkg/download.go

+ 2 - 0
pkg/download.go

@@ -37,6 +37,8 @@ func (c *ClICtrl) downloadAndDecrypt(
 	if err != nil {
 		log.Printf("Error decrypting file %d: %s", file.ID, err)
 		return nil, model.ErrDecryption
+	} else {
+		_ = os.Remove(downloadPath)
 	}
 	return &decryptedPath, nil
 }