vishalsh13's picture
commit as its working on local
e4dba65
raw
history blame contribute delete
384 Bytes
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