diff --git a/src/pytest_html/extras.py b/src/pytest_html/extras.py
index f64a0eb5..12d91a67 100644
--- a/src/pytest_html/extras.py
+++ b/src/pytest_html/extras.py
@@ -8,6 +8,7 @@
FORMAT_TEXT = "text"
FORMAT_URL = "url"
FORMAT_VIDEO = "video"
+FORMAT_BINARY = "binary"
def extra(content, format_type, name=None, mime_type=None, extension=None):
diff --git a/src/pytest_html/result.py b/src/pytest_html/result.py
index f791e6d7..30f1af6c 100644
--- a/src/pytest_html/result.py
+++ b/src/pytest_html/result.py
@@ -116,6 +116,15 @@ def append_extra_html(self, extra, extra_index, test_index):
content, extra_index, test_index, extra.get("extension")
)
+ elif extra.get("format_type") == extras.FORMAT_BINARY:
+ content = extra.get("content")
+ if self.self_contained:
+ href = self._data_uri(content, mime_type=extra.get("mime_type"))
+ else:
+ href = self.create_asset(
+ content, extra_index, test_index, extra.get("extension"), "wb"
+ )
+
elif extra.get("format_type") == extras.FORMAT_TEXT:
content = extra.get("content")
if isinstance(content, bytes):