By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Display a pdf through byte stream in IE7 ?

P: 1
I want to display a pdf through byte stream in IE7. For example:
.........
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("content-disposition", "inline;filename=file.pdf");
.........

It works well in IE6/IE7/FIREFOX+adobe reader6.0. But it will get a save dialog in browser to force me to download the pdf file in IE7+adobe reader8.0. That means I can't see pdf in web browser, I can only save the pdf file. I can't get the reason, who can help me? Thank you!
Apr 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: 1
Try the following:

Response.ContentType = "application/pdf";
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("content-disposition", "inline");
Response.AddHeader("Content-Length", ByteStream.Length.ToString); <== (where "ByteStream" is your bytestream variable)

I'm not too keen on the code syntax, but I believe specifying that last line will send the bytestream to the browser window (or Adobe window, depending on the Reader setting about browser integration). Hope this helps!

- KC
May 22 '07 #2

Plater
Expert 5K+
P: 7,872
Remove the content dispostion. That really ONLY works for attachments
May 22 '07 #3

Plater
Expert 5K+
P: 7,872
Remove the content dispostion. That really ONLY works for attachments
Also, be sure to check with:
HTTP 1.0 RFC1945
and
HTTP 1.1 RFC2616
May 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.