TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
srivalli.chavali
NA
13
0
Programmatically display .MHT files inline
May 18 2005 5:32 PM
Hi. I have a PDF file and a MHT file. Following is the code I'm using to read the file and display it INLINE in the browser. PageData is a MemoryStream object that contains the file's actual stream of bytes. ---------------------------- PDF files ---------------------------- Response.ContentType = "application/pdf"; Response.AddHeader("Content-Type", "application/pdf"); Response.AddHeader("content-disposition", "inline;filename=file.pdf"); PageData.WriteTo(Response.OutputStream); ---------------------------- MHT files ---------------------------- Response.ContentType = "message/rfc822"; Response.AddHeader("Content-Type", "message/rfc822"); Response.AddHeader("content-disposition", "inline;filename=file.mht"); PageData.WriteTo(Response.OutputStream); Using the above code, I can successfully view the PDF files, but NOT MHT files. For MHT files, Blank IE window appears and the "View Source" displays the following HTML. ----
---- Please note that I can view both PDF and MHT files successfully as attachments, as opposed to being inline. i.e., Response.AddHeader("content-disposition", "attachment;filename=file.mht"); works absolutely fine. I'm wondering if MHT files can be viewed inline at all. If yes, please let me know where I'm doing it wrong. Thanks in advance. -Srivalli.
Reply
Answers (
0
)
scraping html contents from web pages
Problems in creating a asp.net app in Visual Studio.net