extracting zip files to a s3 bucket in django project

Viewed 208

I am new to Django and aws. I want to extract the zip file uploaded by the user in Django, files are stored perfectly in the s3 bucket when the user uploads it, but the problem is I am not able to extract the files to the s3 folder

new_folder_name = random.randint(0, 68764446643313679)
folder_unzip = os.path.join(settings.MEDIA_ROOT, 'Unzipped')
print(folder_unzip)
file_path = os.path.join(folder_unzip, str(new_folder_name))
zip_file = zipfile.ZipFile(self.ebook)
zip_file.extractall(file_path)

Can anyone help me with this

0 Answers
Related