There's a web site I visit that includes a document which is returned with content type text/plain and my version of Google Chrome used to display it in the browser window, as plain text. I like it that way. However, it has started to download the document now when I visit it, instead, meaning I have to open it with a text editor to view it. How can I make Chrome return to the old behaviour?

link|improve this question
Try clearing your temp files and cache. – random Apr 1 '10 at 8:27
2  
Are you sure other browsers don't download it as well? The server might tell them to do so. Peek into the headers using the Web Inspector. Or give us a URL? – Arjan Apr 1 '10 at 8:55
feedback

3 Answers

The reason is most likely that the server is telling the client (browser) to download the file. This is controlled (usually) via the HTTP header

Content-disposition: attachment

(optionally with a filename).

Check if the server serves your document with this header. To view the headers, you can download the page using a tool that preserves HTTP headers (e.g. wget --save-headers), or use an online service, e.g. http://web-sniffer.net/ .

Then post the headers here, or even better, the document's URL (if you can).

link|improve this answer
feedback

Can you verify that the Content-Type is actually 'text/plain'? You can do so in by going to View -> Developer -> Developer Tools and viewing the response headers on the file. I've seen situations where the Content-Type is unrecognized (i.e. 'plain/text'), and therefore causes the file to be downloaded rather than displayed.

link|improve this answer
feedback

You could try doing

view-source:http://example.com/the-text-document.txt

Which should let you see the document in chrome regardless of the headers

link|improve this answer
Nope. I just tried that. – nalply Oct 9 '11 at 15:24
feedback

Your Answer

 
or
required, but never shown