diff --git a/icepyx/core/granules.py b/icepyx/core/granules.py index c3fb7ab70..ee9b80402 100644 --- a/icepyx/core/granules.py +++ b/icepyx/core/granules.py @@ -387,7 +387,10 @@ def download(self, verbose, path, session=None, restart=False): # #Note: extract the dataset to save it locally # if extract is True: with zipfile.ZipFile(io.BytesIO(zip_response.content)) as z: - z.extractall(path) + for zfile in z.filelist: + # Remove the subfolder name from the filepath + zfile.filename = os.path.basename(zfile.filename) + z.extract(member=zfile, path=path) # update the current finished order id and save to file with open(downid_fn,'w') as fid: