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

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

The MIME type text/x-gdscript signals that a file contains code written in GDScript. It is tailored for the Godot game engine. The code is plain text and human readable. Editors use this information to apply syntax highlighting.



Files using this MIME type typically have the extension GD. This helps systems and tools know how to process and edit the file properly.


More information is available via the Godot Engine website.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: text/x-gdscript    
  

HTML

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


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

Associated file extensions

FAQs

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

This MIME type identifies source code files written in GDScript, the primary scripting language for the Godot Engine. It tells the operating system and development tools that the file contains high-level game logic, typically stored in files with the .gd extension.

Can web browsers execute text/x-gdscript files?

No, web browsers cannot natively execute GDScript. Browsers rely on JavaScript and WebAssembly; to run a Godot game on the web, you must export the project to HTML5, which compiles the text/x-gdscript logic into a format compatible with modern browsers.

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

To ensure your Apache server sends the correct Content-Type header, add the following line to your .htaccess file or server configuration: AddType text/x-gdscript .gd. This helps client applications recognize the file as a script rather than generic plain text.

Why does the MIME type include the "x-" prefix?

The x- prefix in text/x-gdscript indicates that it is a non-standard subtype not officially registered with the IANA. It signals to software that the format is specific to a particular environment—in this case, the Godot game development ecosystem.

What software opens files with the text/x-gdscript type?

These files are best opened using the Godot Engine editor, which provides integrated debugging and autocompletion. However, since the content is plain text, you can also view and edit them in tools like Visual Studio Code, Sublime Text, or Notepad++, often with plugins installed for syntax highlighting.

Is text/x-gdscript safe to download and open?

As a plain text format, the file itself cannot harm your computer when viewed in a text editor. However, because it contains executable logic intended for the Godot Engine, you should treat downloaded .gd files with caution and only run scripts from trusted sources to avoid executing malicious game code.

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.