.glb MIME type
glTF binary3d models
model/gltf-binaryBinary glTF: a 3D scene with its meshes, materials and textures packed into one file. The web's default 3D format.
| MIME type | model/gltf-binary |
|---|---|
| Extensions | .glb |
| Content-Type | model/gltf-binary |
| Compress in transit? | No — already compressed |
| File signature | 67 6C 54 46 (glTF) |
Good to know
- three.js's GLTFLoader, Babylon.js and the
<model-viewer>element all load it without checking the type. But most servers have no.glbmapping and sendapplication/octet-stream; set it so CDNs label and cache the file correctly. - Loading a model from another origin needs CORS headers, like any
fetch.
Useful here: Access-Control-Allow-Origin
Serve .glb files with the right type
The response header to send:
Content-Type: model/gltf-binary
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
model/gltf-binary glb;
Apache (.htaccess or server config)
AddType model/gltf-binary .glb
Express
res.set("Content-Type", "model/gltf-binary");Python
import mimetypes
mimetypes.add_type("model/gltf-binary", ".glb")HTML file input
<input type="file" accept=".glb,model/gltf-binary">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.glb | grep -i '^content-type:' file --mime-type file.glb
Frequently asked questions
What is the MIME type for .glb files?
model/gltf-binary.
What Content-Type header should a .glb file be served with?
Content-Type: model/gltf-binary. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .glb?
Check its bytes rather than the extension: GLB files start with 67 6C 54 46 (glTF). On the command line, file --mime-type name.glb does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options