link to open txt file in notepad

  • Thread starter Thread starter Daves
  • Start date Start date
D

Daves

a simple aspx page just needs to send a particular .txt file to stream so
that it opens up in Notepad on client side. Using ContentType = "text/plain"
it still opens in IE browser as a html file, what trick is needed?
 
a simple aspx page just needs to send a particular .txt file to stream so
that it opens up in Notepad on client side. Using ContentType = "text/plain"
it still opens in IE browser as a html file, what trick is needed?

Do you have the http-header Content-Disposition=attachment ?

Response.AppendHeader("Content-Disposition", "attachment");

or even

Response.AppendHeader("Content-Disposition",
"attachment;filename=file.txt");



Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top