download files and display page?

Steve Smythe ssmythe at docent.com
Wed Dec 10 13:17:37 CST 2003


Hi Keary,

Based on everyone's response, I've come to the conclusion
that I'm going to go the route of having a separate download
script that is passed:

    http://www.foobar.com/download.pl/sid/skey/foo.exe

And have the sid and skey (session id and key) point to a
session variable that has the full path to the file and
then write the file to STDOUT in binmode (using the
application/force-download mime-type), and then send an
email when the file is finished transmitting.

This way, I still get the confirmation I need and the
list of file links still remains visible to the user.

Thanks everyone for your help,

Steve


-----Original Message-----
From: Keary Suska [mailto:hierophant at pcisys.net] 
Sent: Wednesday, December 10, 2003 9:06 AM
To: Pikes Peak Perl Mongers
Subject: Re: download files and display page?

on 12/8/03 2:45 PM, ssmythe at docent.com purportedly said:

> I'm trying to set up a file download app that will
> allow the user to get a list of files, click on a link,
> have the file save dialog appear in the user's
> browser, then once the file download completes,
> have a confirmation page displayed.
> 
> Can anyone recommend how to do this?

I don't think it's technically possible. You could try sending the download
with a 302 status, but I am not sure how that behavior is defined by the
HTTP spec, and how browsers would handle it.

You can do the reverse order--display page then download--using a
meta-refresah or JavaScript. A JavaScript may execute before a page is
rendered, which may appear to happen first when it really doesn't. Putting
your script before the <HEAD> tag should give you the earliest execution.

Best regards,

Keary Suska
Esoteritech, Inc.
1205 N Prospect Street
Colorado Springs, CO 80903
(719) 473-6431
(719) 440-9952 (cell)




More information about the Pikes-peak-pm mailing list