diff --git a/glare/objects/meta/file_utils.py b/glare/objects/meta/file_utils.py index 680c1a2..93d0276 100644 --- a/glare/objects/meta/file_utils.py +++ b/glare/objects/meta/file_utils.py @@ -102,12 +102,13 @@ def upload_content_file(context, af, data, blob_dict, key_name, af.update_blob(context, af.id, blob_dict, getattr(af, blob_dict)) -def unpack_zip_archive_in_memory(context, af, fd): - """Unpack zip archive in memory. +def unpack_zip_archive_in_memory(context, af, field_name, fd): + """Unpack zip archive in memory and write its content to artifact folder. :param context: user context :param af: artifact object - :param fd: file + :param field_name: blob dict name where to unpack the data + :param fd: zip archive :return io.BytesIO object - simple stream of in-memory bytes, None """ flobj = io.BytesIO(fd.read()) @@ -122,6 +123,6 @@ def unpack_zip_archive_in_memory(context, af, fd): if not name.endswith('/'): upload_content_file( context, af, utils.BlobIterator(zip_ref.read(name)), - 'content', name) + field_name, name) flobj.seek(0) return flobj, None