From b9050a70214b1a8db1f4158173e5c783de81acda Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 11 Aug 2022 11:41:24 +0200 Subject: [PATCH] Allegati: aggiunta entropia al nome file temp. --- allegati.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/allegati.go b/allegati.go index f49d33c..19cc5ab 100644 --- a/allegati.go +++ b/allegati.go @@ -32,11 +32,14 @@ func AllegatoSalva(allegati_dir string, file multipart.File, file_header *multip ora := time.Now() filename := filepath.Join(allegati_dir, - fmt.Sprintf("%d%02d%02d%02d-%s", + fmt.Sprintf("%04d%02d%02d%02d%02d%02d%02d-%s", ora.Year(), ora.Month(), ora.Day(), - rand.Intn(10), + ora.Hour(), + ora.Minute(), + ora.Second(), + rand.Intn(99), file_header.Filename)) tmpfile, err := os.Create(filename) -- 2.49.0