Spaces:
Runtime error
Runtime error
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 | |