我有一个视图如何上传png pdf docs之类的文件,我想提取一个zip文件并上传我所有的文件,如何在zip文件中找到COM = zipfile 如果formData [“ category”] == Advertisement.MEDIA [0]: 如果file_type =='COM':
with ZipFile(files_uploaded['file'], 'r') as z:
for f in z.namelist():
names = z.namelist()
for i in range(len(names)):
bs = False
else:
ad.file = img_upload_to_file(
company, files_uploaded['file'], formData["file_generated"], file_type, log)
ad.duration = get_duration_according_by_file_type(
formData, ad.file)
ad.save()