What is MIME type "text/csv-schema"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
text/csv-schema is a text-based MIME type that describes a schema for CSV files. It defines the structure, rules, and data types used in comma-separated values. This helps software confirm that a CSV file follows a specific layout.- Validation: Programs check CSV files against the schema to ensure consistent formatting.
- Interoperability: Different systems can share and process CSV data reliably.
- Data Migration: It eases data transfers by clarifying how data should be organized.
- Documentation: The schema explains the columns, expected data types, and order.
Files using this MIME type typically have the CSVS extension. It is plain text, making it easy to edit with any text editor. More details on MIME types can be found at IANA media types.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: text/csv-schema
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="text/csv-schema">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/csv-schema');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
What is the purpose of the text/csv-schema MIME type?
text/csv-schema is used to serve files that define the structure, constraints, and data types expected in a CSV file. Unlike standard data files, these files act as a blueprint to validate that a corresponding text/csv file contains the correct columns and formatting.
How do I configure Apache to serve .csvs files correctly?
To associate the extension with this MIME type in Apache, add the line AddType text/csv-schema .csvs to your .htaccess file or main configuration. This ensures that when a user requests a schema file, the server sends the correct Content-Type header.
How do I add text/csv-schema support to Nginx?
In your Nginx configuration (usually nginx.conf or an included mime.types file), add the entry text/csv-schema csvs; inside the types { ... } block. After saving the file, reload Nginx to apply the changes.
Can I open text/csv-schema files in Microsoft Excel?
Generally, no; Excel is designed to open the actual data (.csv), not the schema definition. Since files with the csvs extension are plain text, they are best viewed and edited using code editors like VS Code or Notepad++.
Is text/csv-schema a standard IANA MIME type?
While text/csv is a standard type, text/csv-schema is often used provisionally or within specific ecosystems (like the CSV Schema Language) to distinguish metadata from actual data. Always ensure your validation software supports this specific Content-Type before deploying.
What is the difference between text/csv and text/csv-schema?
text/csv contains the actual tabular data (rows and columns of information), whereas text/csv-schema contains metadata about that data. You use the schema to verify that the data file follows specific rules, such as required fields or data types (e.g., integers vs. strings).
Why is my browser downloading the .csvs file instead of displaying it?
This usually happens if the server sends a Content-Disposition: attachment header or if the browser doesn't recognize text/csv-schema as a renderable text format. You can force it to display inline by ensuring the server sends Content-Type: text/csv-schema and Content-Disposition: inline.
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.