What is MIME type "text/x-setext"?

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

text/x-setext is a MIME type for plain text files that use the Setext markup style.
It enables simple formatting without heavy code. Text is structured by underlining, which indicates headings.
Files with this MIME type use the extension ETX.
Learn more about MIME types at MIME on Wikipedia.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: text/x-setext    
  

HTML

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


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

Associated file extensions

FAQs

What is the text/x-setext MIME type used for?

This MIME type represents documents formatted with Setext (Structure Enhanced Text), a lightweight markup language. These files, typically using the .etx extension, rely on visual cues like underlining to define headings and structure within plain text.

How do I open an .etx file?

Since Setext files are essentially plain text, you can open them with any standard text editor such as Notepad, TextEdit, or VS Code. While they contain formatting syntax, the content remains human-readable without specialized software.

How do I configure an Apache server to serve .etx files?

To ensure your Apache server sends the correct headers, add the following line to your .htaccess file or main configuration: AddType text/x-setext .etx. This tells the server to associate the extension with the MIME type.

What is the Nginx configuration for text/x-setext?

For Nginx, you need to update your mime.types file or the types block in your server config. Add the mapping: text/x-setext etx;. Be sure to reload Nginx for the changes to take effect.

Is text/x-setext the same as Markdown?

No, but Setext is a precursor to Markdown. While Markdown supports "Setext-style headers" (underlining text with === or ---), the text/x-setext MIME type refers specifically to the older Structure Enhanced Text standard, whereas Markdown uses text/markdown.

Why is my browser downloading the .etx file instead of displaying it?

This often happens if the server sends a Content-Disposition: attachment header or if the browser does not recognize the x- prefix as renderable text. Ensure your server sends the Content-Type: text/x-setext header, or try changing the MIME type to text/plain for broader compatibility if strict Setext support isn't required.

Are there security risks associated with text/x-setext files?

Generally, no. These files are plain text and do not contain executable code or macros. However, standard precautions apply: ensure the file is truly a text file and not a malicious executable disguised with a misleading extension.

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.