When inserting images to object storage, pixeltable does not set the Content-Type
I'm working on a multimodal app that loads a bunch of gameplay screenshots into a pixeltable table and then indexes them with an embedding model so I can search by the contents. My import code looks like this:
import pixeltable as pxt
from datasets import load_dataset
from uuid_extensions import uuid7
@pxt.udf
def gen_uuid() -> str:
return str(uuid7())
def import_screenshots():
dataset = load_dataset("XeIaso/switch-screenshots")
screenshots = pxt.create_table("screenshots", source=dataset)
screenshots.add_embedding_index(
"image",
embedding=clip.using(model_id="openai/clip-vit-large-patch14"),
)
screenshots.add_computed_column(uuid=gen_uuid())
return screenshots
When I configure Pixeltable to use object storage (s3, tigris, b2, etc.) as the storage backend, the images don't have a Content-Type header set. This makes object storage return the following HTTP headers:
< HTTP/2 200
< accept-ranges: bytes
< content-type: binary/octet-stream
< etag: "345fdc95884bbfcef0074bcf2b61cedd"
< last-modified: Wed, 26 Nov 2025 18:06:14 GMT
< server: Tigris OS
< server-timing: total;dur=16,cache;desc=read;dur=0.770000, block;desc=local;dur=10
< x-amz-content-sha256: STREAMING-UNSIGNED-PAYLOAD-TRAILER
< x-amz-date: 20251126T180614Z
< x-amz-request-id: 1764188375577315564
< x-tigris-regions: iad1
< x-tigris-served-from: iad
< content-length: 82522
< date: Wed, 26 Nov 2025 20:19:35 GMT
Notably:
< content-type: binary/octet-stream
When browsers see this Content-Type in responses, they will default to downloading the file instead of displaying it. This is most notable when you embed a presigned URL to that image in a HTML <img> tag to show it in a browser.
Feature request: Please add a Content-Type header using the MIME sniffing standard when making S3API PutObject calls, or at least guessing it the by the extension.