What is MIME type "text/vcard"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
text/vcard is a MIME type for handling vCard files. These files store and exchange contact information like names, phone numbers, and email addresses.The content is plain text and follows a standardized format. It makes it easy to import contact details into address books and email clients. Files using this MIME type include the VCF and VCARD formats.
Key points:
- Efficient exchange of personal and business contact information
- Easy integration with email programs, smartphones, and contact management apps
- Supports standardized formatting for data consistency
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: text/vcard
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="text/vcard">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/vcard');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
What is the text/vcard MIME type used for?
The text/vcard MIME type represents electronic business cards (vCards). It is used to transmit contact information, such as names, phone numbers, and addresses, allowing users to import details directly into applications like Outlook, Apple Contacts, or Android address books.
How do I configure Apache to serve .vcf files correctly?
To ensure Apache serves vCards with the correct MIME type, add the line AddType text/vcard .vcf .vcard to your .htaccess file or your main server configuration. This prevents browsers from treating the file as generic plain text.
How do I add text/vcard support to Nginx?
You should verify that your mime.types file (usually located in /etc/nginx/) contains the entry text/vcard vcf vcard;. If it is missing, add it inside the types block and reload Nginx to apply the changes.
Should I use text/vcard or text/x-vcard?
text/vcard is the official standard defined in RFC 6350 (vCard 4.0). While text/x-vcard was commonly used in the past and is still supported by many legacy systems, you should prioritize using the standard text/vcard for modern web development.
Why is the browser displaying the VCF code instead of downloading the file?
This usually happens if the server sends the file with a Content-Disposition: inline header or if the MIME type is missing. To force the browser to prompt a download, configure your server to send the header Content-Disposition: attachment; filename="contact.vcf".
What file extensions are associated with text/vcard?
The primary extension is .vcf, which stands for Virtual Contact File. Occasionally, the full .vcard extension is used, but .vcf is the industry standard for file interoperability.
Is text/vcard compatible with mobile devices?
Yes, text/vcard is highly compatible with mobile operating systems like iOS and Android. When a mobile browser encounters this MIME type, it typically prompts the user to add the contact details directly to their phone's address book.
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.