Spaces:
Runtime error
Runtime error
File size: 384 Bytes
975d1b2 4ad299d e4dba65 4ad299d e4dba65 975d1b2 e4dba65 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import os
import zipfile
def handle_zip_upload(v_zip_path):
"""
Extracts the ZIP into the same folder as v_zip_path.
If v_zip_path = 'app/uploads/myfile.zip', extracts into 'app/uploads'.
"""
v_parent_folder = os.path.dirname(v_zip_path)
with zipfile.ZipFile(v_zip_path, 'r') as obj_zip:
obj_zip.extractall(v_parent_folder)
return v_parent_folder
|