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.

Ryan

In reply to Creating dynamically named CGIs by ryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.