From d9c1892a4e25445a620dadcf6032c56dc6030344 Mon Sep 17 00:00:00 2001 From: zmister Date: Thu, 23 Sep 2021 11:28:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96zip=E6=96=87=E9=9B=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_doc/views_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_doc/views_import.py b/app_doc/views_import.py index 5f3c054..8405503 100644 --- a/app_doc/views_import.py +++ b/app_doc/views_import.py @@ -49,7 +49,7 @@ def import_project(request): if file_name.endswith('.zip'): if os.path.exists(os.path.join(settings.MEDIA_ROOT,'import_temp')) is False: os.mkdir(os.path.join(settings.MEDIA_ROOT,'import_temp')) - temp_file_name = str(time.time())+'.zip' + temp_file_name = datetime.datetime.now().strftime('%Y%m%d%H%M%S%f') +'.zip' temp_file_path = os.path.join(settings.MEDIA_ROOT,'import_temp/'+temp_file_name) with open(temp_file_path,'wb+') as zip_file: for chunk in import_file: