Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

initiating a download from an apache dso

1 view
Skip to first unread message

Sean Farrow

unread,
Aug 3, 2008, 3:31:32 PM8/3/08
to
Hi:
I need to display some html, perform actions on the server and then initiate
a file download. how do I go about this?
any help apreciated.
Sean


Dan Downs

unread,
Aug 3, 2008, 8:04:30 PM8/3/08
to


By "initiate a file download" do you mean:

1. the user clicks a link
2. the download is pushed to the browser
3. the download starts after a certain time period


Number 1 is easy, same for any webbroker app, number 2 could be faked
and kind of ties into number 3.


DD

Sean Farrow

unread,
Aug 4, 2008, 9:53:31 AM8/4/08
to
Hi:
I mean 2, I don't want the user to click anything.
Any help apreciated.
Sean.
"Dan Downs" <ddo...@nospam.online-access.com> wrote in message
news:4896478d$1...@newsgroups.borland.com...

Dan Downs

unread,
Aug 4, 2008, 12:15:00 PM8/4/08
to
Sean Farrow wrote:
> Hi:

> I mean 2, I don't want the user to click anything.
> Any help apreciated.

in that case the easiest way is to fake the push either by a meta
refresh, or depending on what needs to happen on the server (building a
custom setup for the user, building reports, etc...) an ajax request
loop in the background of the page checking in with the dso to see if
the task is done and then pulling the file down.

I'm not sure on the specifics of downloading by ajax request, how/if it
prompts the user, but this could be gotten around by changing a hidden
iframe to the download path once the task is done.


Something like that?

DD

Sean Farrow

unread,
Aug 5, 2008, 4:53:58 AM8/5/08
to
Yes, Any pointers?
Never dealt with ajax!
I want to prompt th user, just with no links.

Sean.
"Dan Downs" <ddo...@nospam.online-access.com> wrote in message
news:48972b03$1...@newsgroups.borland.com...

Dan Downs

unread,
Aug 5, 2008, 9:56:31 AM8/5/08
to
A quick test would be to make a html page with a hidden iframe (size
1x1, css display hidden, etc) and set its source to something to
download. Load the page and see what happens. If there's no time delay
needed this could be your solution.

If a time delay is needed, things get a bit more complicated because
you'll need a thread safe way to keep track of your server side tasks,
I've used kbmMemTable with much success for various caching routines in
the past.

Once thats in place then you need a way to check it, meta refresh tag
inside the iframe to check in every 10 seconds. If its not done you
return the page with the refresh. When it is done return a different
page with the meta refresh set to the download path. It should prompt
the user to download. Oh.. the first time the page is loaded the iframe
would point to a url that'll create the task/job then return the refresh
page with the job number in the url.


A lot of this you can test by just making few static pages to work out
the flow and see if its the right direction.

For ajax stuff, you'll best source would be google for examples, but the
iframe refresh would be more compatible with various browsers (I really
hope no one is still using IE 4).

DD

0 new messages