|
@@ -158,16 +158,16 @@ class VersionManagement(View):
|
|
equipment_version_qs.update(**data_dict)
|
|
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)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(500, repr(e))
|
|
return response.json(500, repr(e))
|