•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 391,593 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,683 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 3830 | Replies: 5
![]() |
•
•
•
•
Originally Posted by tgreer
The MIME-type should be text/plain. However, you should also give your file the .txt file extension, because IE ignores MIME-types, using instead the OS' file associations.
Can you give me a sample of how to set it? Basically the page is simply displaying the words (and then the text):
Content-Type: text/plain
but the browser is not acting on it and serving it up for me to download..
What server-side language are you using to create the file? Here's a PHP example:
You can provide a meta-tag, however, it may not work in all browsers. The proper way is to set the MIME-type in the HTTP headers (which is what PHP is doing, above), rather than in the HTML document itself. The meta-tag:
That would go in the "head" section of your HTML.
<?
header("Content-type: text/plain");
?>You can provide a meta-tag, however, it may not work in all browsers. The proper way is to set the MIME-type in the HTTP headers (which is what PHP is doing, above), rather than in the HTML document itself. The meta-tag:
<META HTTP-EQUIV="Content-Type" CONTENT="text/plain">
That would go in the "head" section of your HTML.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
- ENCRYPTION AND DECRYPTION - How to disable the File menu in a Notepad or any file (VB.NET)
- import a text from notepad (Visual Basic 4 / 5 / 6)
- Opening a notepad file (C#)
- Output in Text file-How to apply fprintf()? (C)
Other Threads in the HTML and CSS Forum
- Previous Thread: CSS External Linking Problems
- Next Thread: Hidden Counter



Linear Mode