瀏覽代碼

注释上传文件至服务器

guanhailong 2 年之前
父節點
當前提交
1c437b4aa2
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      AdminController/VersionManagementController.py

+ 10 - 10
AdminController/VersionManagementController.py

@@ -158,16 +158,16 @@ class VersionManagement(View):
                 equipment_version_qs.update(**data_dict)
 
             # 上传文件到服务器
-            upload_path = '/'.join((BASE_DIR, 'static/otapack', mci, lang)).replace('\\', '/') + '/'
-            if not os.path.exists(upload_path):  # 上传目录不存在则创建
-                os.makedirs(upload_path)
-            # 文件上传
-            full_name = upload_path + file_name
-            if os.path.exists(full_name):  # 删除同名文件
-                os.remove(full_name)
-            with open(full_name, 'wb+') as write_file:
-                for chunk in file.chunks():
-                    write_file.write(chunk)
+            # upload_path = '/'.join((BASE_DIR, 'static/otapack', mci, lang)).replace('\\', '/') + '/'
+            # if not os.path.exists(upload_path):  # 上传目录不存在则创建
+            #     os.makedirs(upload_path)
+            # # 文件上传
+            # full_name = upload_path + file_name
+            # if os.path.exists(full_name):  # 删除同名文件
+            #     os.remove(full_name)
+            # with open(full_name, 'wb+') as write_file:
+            #     for chunk in file.chunks():
+            #         write_file.write(chunk)
             return response.json(0)
         except Exception as e:
             return response.json(500, repr(e))