473,387 Members | 1,859 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.

HTTP headers ? How to pipe an ASP file through ?

Hi Guys,

I have a problem, and I would be grateful for any help.

My WebApp has to do some database work in page1.ASP Because this may
take a few second, before Page1 connects to the database, it doeas a
"Response.Buffer=false", and pumps out a bit of javascript which
displays a progress bar.

SO far so good.

When the database call is completed, I then write out a bit more
javascript to stop the progress bar.

Now, I have a binary fields retrieved from the database, which needs to
be written like this :

<%
Response.ContentType = "application/pdf" [error]
response.BinaryWrite (mydatabase field)
%>

Of course I am getting an error about HTTP headers having been written
already.

Can anyone suggest a way that I can display this PDF from Page1.asp ?
At the moment, one I have done the database work (which populates the
database) I have to transfer to PAGE2.ASP which then has to open the
database, and retrieve the field again. The problem is that this
process takes a few seconds too, which also requires the progressbar
!!!!!

What I would like to do, (if it's possible) is something like this :

PAGE1.ASP
<%
....[code to intialise progressbar]...
....[database call]...
....[clear progress bar]...
....[write db field as PDF]...
%>

thanks in advance

Jul 11 '06 #1
2 1783

<je*******@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi Guys,

I have a problem, and I would be grateful for any help.

My WebApp has to do some database work in page1.ASP Because this may
take a few second, before Page1 connects to the database, it doeas a
"Response.Buffer=false", and pumps out a bit of javascript which
displays a progress bar.

SO far so good.

When the database call is completed, I then write out a bit more
javascript to stop the progress bar.

Now, I have a binary fields retrieved from the database, which needs to
be written like this :

<%
Response.ContentType = "application/pdf" [error]
response.BinaryWrite (mydatabase field)
%>

Of course I am getting an error about HTTP headers having been written
already.

Can anyone suggest a way that I can display this PDF from Page1.asp ?
At the moment, one I have done the database work (which populates the
database) I have to transfer to PAGE2.ASP which then has to open the
database, and retrieve the field again. The problem is that this
process takes a few seconds too, which also requires the progressbar
!!!!!

What I would like to do, (if it's possible) is something like this :

PAGE1.ASP
<%
...[code to intialise progressbar]...
...[database call]...
...[clear progress bar]...
...[write db field as PDF]...
%>
The request should ultimately return a PDF. Since a PDF doesn't begin with
Javascript code you've corrupted the download before you have even begun.

One thing you might try is an accessor page which launches a modeless dialog
containng your progress bar then navigates to the page that delivers the
PDF. The when the PDF starts to download the internal window containing
your accessor page will be closed to be replaced with the PDF at this point
the modelss dialog will be closed automatically for you.

I'm not sure how this would work in a non-IE environment though.
thanks in advance

Jul 11 '06 #2
Not sure if this follows your business rules, but what I've done in the past
is create an actual PDF file in a temp virtual directory, and then have the
page that created the file redirect to that file. If the information is
sensitive, make sure you have some sort of cleanup routine (possibly
triggered when a session ends).

"je*******@hotmail.com" wrote:
Hi Guys,

I have a problem, and I would be grateful for any help.

My WebApp has to do some database work in page1.ASP Because this may
take a few second, before Page1 connects to the database, it doeas a
"Response.Buffer=false", and pumps out a bit of javascript which
displays a progress bar.

SO far so good.

When the database call is completed, I then write out a bit more
javascript to stop the progress bar.

Now, I have a binary fields retrieved from the database, which needs to
be written like this :

<%
Response.ContentType = "application/pdf" [error]
response.BinaryWrite (mydatabase field)
%>

Of course I am getting an error about HTTP headers having been written
already.

Can anyone suggest a way that I can display this PDF from Page1.asp ?
At the moment, one I have done the database work (which populates the
database) I have to transfer to PAGE2.ASP which then has to open the
database, and retrieve the field again. The problem is that this
process takes a few seconds too, which also requires the progressbar
!!!!!

What I would like to do, (if it's possible) is something like this :

PAGE1.ASP
<%
....[code to intialise progressbar]...
....[database call]...
....[clear progress bar]...
....[write db field as PDF]...
%>

thanks in advance

Aug 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin Kofahl | last post by:
Hello, I'm slightly confused with the passthru() command. The program I call writes html headers itself. However, passthru() makes apache sending some generated headers first. There's no fault...
1
by: Brad Murdoch | last post by:
im trying to run the select.selct() on a unix pipe, my expectation is that it will block untill there is something there to read, then continue. It seems to do this untill the pipe is written to...
5
by: richard | last post by:
I have a simple test to pass information from a client to a server using named pipe. what I really want is: when I type a line on the client, the server will output the line immediately. but to my...
15
by: Dave | last post by:
Hello NG, It is well known that memory-allocating definitions should not be put in a header file. I believe, however, that this does not apply to const definitions. For example: #ifndef...
6
by: Chapman Flack | last post by:
Ok, I've registered all the right headers to send, with header( 'Content-Type: .../...') etc. The next thing to do is exec a program that will be producing the actual content. The content MUST...
7
by: Greg | last post by:
I am trying to implement the UNIX pipe command using C but with the "->" operator. Everything works fine with 1 pipe, but when I try to use 2 or more, it hangs up when reading the pipe_in...
4
by: bill | last post by:
I am confused by the behavior of the following code. The function copy() takes two FILE *'s and copies the data from one to the other. In the main routine, I create a pipe and copy stdin to the...
11
by: 7stud | last post by:
Hi, Can someone explain what a broken pipe is? The following produces a broken pipe error: ---------- import subprocess as sub p = sub.Popen(, stdin=sub.PIPE, stdout=sub.PIPE)
1
by: Max58kl | last post by:
Hi I am trying to setup a form that automatically sends the form values via email to a specific address. I have uploaded the script, which when I run loads a page with the following error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.