Take a look at:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html
when you set the content-type you are just sending some helpful information
to the browser for it to know how to open the file. The browser (a) might
not know what to do with the specified content type or (b) might override
your suggestion (ie, just because you sent application/msword, the browser
coudl decide to open the file up in notepad)...
To get your own content type to work in a browser, users must configure
their browsers to recognize the content type and associate with the
appropriate action (ie, open your application). There are certainly ways
to do this, but I don't have the slightest idea how :)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"david" <da***@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Thank you very much, Karl.
It works!
Could you give some hint about my next question:
(1) Whether the ContentType msword is predefined in browser in the code:
Response.ContentType = "application/msword"
(2) If I have my own file processing application, say, fileapp, which can
be
running in client side. Can I use the following code?
Response.ContentType = "application/fileapp"
Thanks
David
"Karl Seguin" wrote:
Try setting the content type and making sure nothing else gets sent along
the way....
Response.ClearContent()
Response.ClearHeaders();
Response.ContentType = "application/msword"
Response.WriteFile(ExportPath)
Response.Flush()
Response.Close()
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"david" <da***@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com... >I has a question:
> I can use Response.WriteFile to display images such as .jpg.
> But I can not us it to display words doc file in EI by calling
> Response.WriteFile("testdoc/DownloadLarge.doc").
> It only shows unreadable chars.
>
> How to use it to show the doc file on webrowser?
>
> Thanks
>
> David