| | |
Output to text (notepad) file
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
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.
Content-Type: text/plain
but the browser is not acting on it and serving it up for me to download..
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
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.
HTML and CSS Syntax (Toggle Plain Text)
<? 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:
HTML and CSS Syntax (Toggle Plain Text)
<META HTTP-EQUIV="Content-Type" CONTENT="text/plain">
That would go in the "head" section of your HTML.
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
HTML and CSS Syntax (Toggle Plain Text)
print "Content-Type: text/plain; charset=utf-8\n\n";
Put this before any page content.
![]() |
Similar Threads
- 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
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity create css design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






