|Just another Perl shrine|
Creating dynamically named CGIsby ryan (Pilgrim)
|on Feb 13, 2002 at 05:42 UTC||Need Help??|
ryan has asked for the
wisdom of the Perl Monks concerning the following question:
This may not be strictly Perl, but I am stuck, and sorry if the title is a little ambiguous. I'm a little unsure how to word this whole cry for help.
I have a site that allows people to download data files stored on the server after authenticating, however the authenticating for reason I will not go into can't be done by Apache, so it is up to the CGIs.
Originally I achieved what I wanted to do by naming one of my CGI files data.zip, such that a call to data.zip?file=somearchive.zip would authenticate the user then output the contents of the requested file to the browser with the appropriate "Content-type: application/zip\n\n" header, but the limitation was the file was always called data.zip at the client end.
I am wanting to make the name of this dynamically generated zip file to be the name of the actual file stored on the server, because the user will download a lot of files in a short space of time on the server, so having unique names is very desirable. I don't want to use a hard link to it for the forementioned security reasons.
Does anyone know if this can be done by either creating some form of dynamically named CGI arrangement or some kind of widely compatible HTML refresh header magic?
Thanks for your time.