473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Display a pdf through byte stream in IE7 ?

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
3 5489
Daspoo
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
7,872 Expert 4TB
Remove the content dispostion. That really ONLY works for attachments
May 22 '07 #3
Plater
7,872 Expert 4TB
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

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

Similar topics

1
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail...
0
by: hlabbott | last post by:
Hi I'm having a problem displaying attachments correctly. I have messages with attachments stored on Exchange2000 and want to be able to click a hyperlink in my project like in OWA and see an...
2
by: nitin8or | last post by:
Hi ALL, I want to display in a RichTextBox the Binary Large Objects data coming from database. If I have one record its not a problem I convert it to byte array and pass it on in a stream as a...
4
by: Dean L. Howen | last post by:
I create my own file format that could content many image files (jpg, ico, ....) . I can get the data of each image, and I want to display it on the form. How can? I've tried to create a file with...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
1
by: Adam | last post by:
I am having difficulty retrieving images from a SQL database. Here is the code I use to UPLOAD the image to the database: <form id="Form1" method="post" enctype="multipart/form-data"...
3
by: Neo Geshel | last post by:
Greetings. I am making an admin interface, which allows me to upload photos to an access DB. The admin interface also needs to display the uploaded photos, but only needs to show them at a...
3
by: harish | last post by:
Hi friends I am facing problem as follow I can't display image from SQL Database to Picture box Control. Here are the codes that I am writing Dim arrPicture() As Byte = _
3
by: computer_guy | last post by:
Hi Everyone, I run into a problem. I am trying to write an aspx that can dynamically generate an image based on some input parameters. Things are very simple if the size of the parameters is...
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.