Make ASP page that polls to wait for a document to be produced

K

kongsballa

Hi!

I have a webapp. that holds a lot of documents. Some of the documents
needs to be produced from a database on-the-fly, some are static
documents like PDF, Word documents, etc... In the end, a user can do a
request to produce a large amount of documents as one huge PDF document.
Today the creation of documents is working, but all code is done in ASP.
In Visual Basic, I was thinking about making an ActiveX EXE server that
generates the PDF document. The ASP page will be polling until the file
is generated. When this is done, the file will be displayed. I have only
written down my thoughts on the subject. Is there a good way to do
this?? Any help is appreciated!

Henning :)
 
R

Richard Hollis

I had a similar problem to this with some views that I am generating on
pages that could be requested during the update.

I achieved this just by wrapping the SleepEx API inside a COM object:

First, identify a way of knowing if you are updating your said document - I
use a lock file to tell this. Use a disk based flag file or something which
is quick and easy to check. That way you can tell if you are updating the
page for subsequent page requests. If you do encounter a subsequent request
for the same page then just sit in a while loop and sleep for a period of
time, up to a maximum period of time, until your condition is satisified -
completion or failure. You could wrap your whole routine in a COM object
and then use a similar approach of sleeping, but checking your object with a
obj.IsComplete() method or something similar.

It can be done though.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,431
Latest member
ElyseG3173

Latest Threads

Top