What is MIME type "model/x.stl-binary"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

model/x.stl-binary is a MIME type for a binary 3D model file format.
It encodes the surface geometry of objects using small triangles. This format is compact and fast to process.
Files using this MIME type typically have the STL extension. For more on STereoLithography and its uses, visit the external reference.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: model/x.stl-binary    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="model/x.stl-binary">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'model/x.stl-binary');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the difference between model/x.stl-binary and text-based STL MIME types?

The model/x.stl-binary type is specific to the binary encoding of Stereolithography files, which is more compact and efficient than the ASCII version. While generic types like model/stl exist, specifying the binary subtype helps applications parse the 3D geometry data faster without checking the file header first.

How do I configure Apache to serve binary STL files?

To ensure your Apache server sends the correct headers for binary stl files, add the following line to your .htaccess or httpd.conf file: AddType model/x.stl-binary .stl. This prevents browsers from trying to interpret the binary data as text.

Do web browsers support viewing model/x.stl-binary files natively?

No, standard web browsers (Chrome, Firefox, Safari) do not render 3D STL files natively. To display these files on a webpage, you must use a JavaScript library like Three.js or a dedicated WebGL viewer that can parse and render the binary geometry.

Why does my STL file display as garbage text when opened in a browser?

This usually occurs because the web server is incorrectly identifying the file as text/plain rather than model/x.stl-binary. When the Content-Type header is wrong, the browser attempts to display the raw binary code as text, resulting in unreadable characters.

Is model/x.stl-binary better for 3D printing than ASCII formats?

Yes, the binary format is the industry standard for 3D printing because it results in significantly smaller file sizes for complex models. Slicing software and 3D printers can process model/x.stl-binary data much faster than parsing large text-based coordinate lists.

How do I add support for this MIME type in Nginx?

Open your nginx.conf or the mime.types file included in your configuration. Add the line model/x.stl-binary stl; inside the types { ... } block. Restart Nginx to apply the changes and ensure correct delivery of your 3D assets.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.