plain text file in aspx

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Saverio Tedeschi (tesis_at_tesis.org)
Date: 04/17/04


Date: Sat, 17 Apr 2004 04:27:22 -0700

Hi all gurus,
forgive me for this stupid question. Even if I'm sure it's treated on
some thread, I was not able to find it.
I've the need to generate a plain text file in MS ASP.NET (it's
generated, of course) and to transfer it in A web page after the request
button is pressed. I was able to generate the file (myExportFile) on the
server, as told, and then issuing the instructions:

            Response.ClearContent()
            Response.ClearHeaders()
            Response.ContentType = "text/plain"
            Response.WriteFile(myExportFile)
            Response.Flush()
            Response.Close()

I should be able to see it in my page. However, all I have is a blank
page. If I change MIME type to "text/html" I obtain a file
unintelligible, with no CR. What is the correct MIME type? Where can I
find a list of all correct MIME types? Can you pls point me to the right
direction? TIA

from tesis-Italy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Windows 2003 and http "filesharing"?
    ... I suggest that you do this in the correct way, and add the extension, and ... set the correct MIME type. ... Kristofer Gafvert - IIS MVP ...
    (microsoft.public.inetserver.iis)
  • Re: Kids bypassing firewall via web proxy sites
    ... This is a standard HTML webpage delivered with the correct MIME type. ... IE would display it as the webpage it is if either you added the MIME ...
    (comp.security.firewalls)
  • Re: Kids bypassing firewall via web proxy sites
    ... This is a standard HTML webpage delivered with the correct MIME type. ... IE would display it as the webpage it is if either you added the MIME ...
    (comp.security.firewalls)
  • Re: Kids bypassing firewall via web proxy sites
    ... This is a standard HTML webpage delivered with the correct MIME type. ... The HTML page is the download. ...
    (comp.security.firewalls)
  • How reliable is mime type in $_FILES superglobal.
    ... This may seem like a stupid question but I want to check before I go ahead and build this... ... I am working on a portal, part of which allows users to upload files. ... Part of the array within $_FILES superglobal gives the mime type for the file. ... If the mime type is not reliable what techniques are available to discover the type of a file? ...
    (comp.lang.php)