Browse Source

Avoid deep directory structure for doanloaded zip

pull/1310/head
Hironsan 3 years ago
parent
commit
846e58805b
1 changed files with 1 additions and 1 deletions
  1. 2
      app/api/views/download/writer.py

2
app/api/views/download/writer.py

@ -23,7 +23,7 @@ class BaseWriter:
save_file = '{}.zip'.format(os.path.join(self.tmpdir, str(uuid.uuid4())))
with zipfile.ZipFile(save_file, 'w', compression=zipfile.ZIP_DEFLATED) as zf:
for file in filenames:
zf.write(file)
zf.write(filename=file, arcname=os.path.basename(file))
return save_file

Loading…
Cancel
Save