What is MIME type "application/x-chess-pgn"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
application/x-chess-pgn is a MIME type for chess game files formatted in Portable Game Notation. It stores moves, game details, and commentary in plain text.This type groups data that many chess programs use for saving and sharing complete games.
It helps software recognize that the file is text-based and follows a standard chess notation.
- Game recording: Keeps move sequences and annotations.
- Data exchange: Allows different chess applications to share game files.
- Archiving: Helps build collections of recorded games.
Files with this type use the extension PGN.
The "x-" prefix indicates this is an experimental or non-standard type.
For more details, check the Portable Game Notation on Wikipedia.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: application/x-chess-pgn
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="application/x-chess-pgn">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-chess-pgn');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
What is the purpose of the application/x-chess-pgn MIME type?
This MIME type identifies Portable Game Notation (PGN) files used to store chess games. It allows web servers to signal to browsers and client software that the incoming file contains structured chess moves and metadata, rather than just generic text.
How do I configure Apache to serve .pgn files correctly?
To ensure your Apache server sends the correct headers for chess files, add the following line to your .htaccess file or httpd.conf: AddType application/x-chess-pgn .pgn. This helps client applications launch the appropriate chess viewer.
Why does my browser download the PGN file instead of showing a chess board?
Browsers do not natively render chess boards from application/x-chess-pgn data. To view the game visually within a webpage, you must use a JavaScript library (like PGN Viewer) to parse the file, or the user needs a specific browser extension or external application installed.
Can I open application/x-chess-pgn files with a text editor?
Yes, PGN files are plain text. Although they are meant for chess software, you can open them in Notepad or TextEdit to view the raw move notation (e.g., "1. e4 e5") and header tags.
How do I add PGN support to Nginx?
You can add the MIME type definition to your Nginx configuration. Edit your mime.types file or the types block in nginx.conf to include: application/x-chess-pgn pgn;. Then reload the server.
What does the "x-" prefix mean in this MIME type?
The x- prefix stands for experimental or non-standard. It indicates that application/x-chess-pgn is not an officially registered IANA standard, though it is the de facto standard used by the chess community for exchanging game data.
Is there a difference between application/x-chess-pgn and application/vnd.chess-pgn?
Both refer to the same file format, but application/x-chess-pgn is more commonly seen in legacy configurations. The vnd. prefix is generally used for vendor-specific types, but for PGN files, the x- version remains widely widely recognized by desktop chess applications.
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.