def METHOD_NAME(test_file, arcname, zip):
    reader = test_file.file
    if hasattr(reader.file, 'name'):
        zip.write(reader.file.name, arcname)
    else:
        with tempfile.NamedTemporaryFile(delete=False) as f:
            shutil.copyfileobj(reader, f)
            f.close()
            zip.write(f.name, arcname)
            os.unlink(f.name)