What is MIME type "application/x-scheme"?

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

application/x-scheme is a MIME type used for files that contain Scheme scripts. This type tells programs that the file holds Scheme source code, allowing proper editing, execution, and debugging.

Files with this type are commonly encountered in programming and scripting. They are used by various Scheme interpreters and development tools. Schemes are often applied in academic and research settings as well as prototype development.

Files associated with this MIME type typically use extensions like SCH, SCM, and SS. They are plain text files that need a Scheme interpreter to run the code.

For additional technical details on Scheme, visit this reference.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: application/x-scheme    
  

HTML

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


    <a href="file.dat" type="application/x-scheme">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', 'application/x-scheme');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What files use the application/x-scheme MIME type?

This MIME type is specifically used for source code written in the Scheme programming language. You will typically see it associated with file extensions like .scm, .ss, and .sch.

How do I configure Apache to serve Scheme files correctly?

To ensure Apache serves these files with the correct header, add the following directive to your .htaccess file or main configuration: AddType application/x-scheme .scm .ss .sch. This prevents browsers from misinterpreting the code as generic text.

Can web browsers execute application/x-scheme files?

No, standard web browsers do not execute Scheme code natively. If a user navigates to a file served with this type, the browser will usually prompt to download it or display it as plain text, unless a specific JavaScript-based interpreter is embedded in the page.

How do I set up Nginx to recognize .scm and .ss files?

You need to update your mime.types file or add a types block inside your server configuration. Use the following syntax: types { application/x-scheme scm ss sch; }, then reload Nginx to apply the changes.

Why does the MIME type start with "x-"?

The x- prefix indicates that application/x-scheme is a non-standard or experimental type, rather than one officially standardized by IANA (like text/html). However, it is the widely accepted convention for identifying Scheme source code on the web.

Is application/x-scheme binary or text?

Files served with this MIME type are plain text. Although the category is application, the content is human-readable source code that can be opened and edited in standard text editors like Notepad, Vim, or VS Code.

Are there security risks associated with serving Scheme files?

Yes, as with any executable source code. If your server is configured to execute these scripts via CGI or a module, allowing users to upload .scm files could lead to Remote Code Execution (RCE). Always serve user-uploaded scripts as static content or plain text to prevent execution.

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.