473,387 Members | 1,553 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,387 software developers and data experts.

PDF displays blank aspx page with content-disposition:inline

10
I am saving PDF files in SQL Server 2005 as an image and retrieve them back by their document ids. I use the following code:

byte

[] buffer = (byte[])dtDoc.Rows[0]["document_content"];

if(buffer != null)
{

Response.ContentType =

"application/pdf";
Response.AddHeader(

"Content-Type", "application/pdf");
Response.AddHeader(

"Content-Length", buffer.Length.ToString());
Response.AddHeader(

"content-disposition", "inline;filename=xyz.pdf");

Response.BinaryWrite(buffer);
}

the above code displays a blank aspx page. However, when I change the content-disposition to 'attachment' instead of 'inline', a dialog box pops up asking to save or just open the file and the code works perfectly. My problem is that I do not want to show users this dialog box but instead, open up the pdf file directly. Is there a way I can do this?
Apr 11 '07 #1
0 2180

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

Similar topics

23
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H...
0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
2
by: Kent | last post by:
Hi all, I have a .aspx page that I would like to Outlook. I can do that from the browser by: File/Send/Page by Email ...but it would be better if I cold send directly to Outlook. How can I...
1
by: Gary Brewer | last post by:
Hi, I often find myself creating ASPX pages in VS.NET that have no 'content' in the aspx page but normally just have code in the code behind page. For example, I use this method when I want to...
2
by: Richard Lionheart | last post by:
Hi All, I adapted some sample code from w3schools.com and tried to adapt it to .NET to test dynamic processing in a WebForm. The client page that got generated produced everything that was...
2
by: K B | last post by:
Hi, I have a basic master page with a title bar and two content placeholders. Then I created a new aspx page with that MasterPage. I added one label control to the content holder as a test. ...
6
by: Peter Michaux | last post by:
Hi, Douglas Crockford mentioned in a video on Yahoo! that before removing an element it is a good idea to purge it's event handlers. I think he was only refering to the event handlers defined...
3
by: jenp | last post by:
Hello I've got a rather tricky problem here - i'm looking to insert a graph into a web page - which is represented as a jpeg image. Due to the restrictions of the framework i'm developing...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
1
by: Sagar | last post by:
Hi, I am working on enhancing an aspx page. The server-side is written with inline code. The coding is not in VS. The task is to make calls a webservice...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.