in reply to Non-Duplicate File Names, Security, and Self Cleaning

From an 'interface' point of view, it makes sense to do this all in one step and (as chromatic and Skeeve suggest) avoid using a temporary file. Having a second 'confirm' screen is not only complicating your code, but making it more troublesome for the user.

It's unlikely that the user will remember specific filenames, so unless your second "directory list" screen also includes thumbnails ("are you sure you wanted these pictures?") , you may as well just use the one main screen full of checkboxes, and the 'Download' button causes the zip file to be written directly to the browser (using Archive::Zip's writeToFileHandle() method I should think - haven't used it myself, but it looks that way from the docs).

Cheers,Ben.

  • Comment on Re: Non-Duplicate File Names, Security, and Self Cleaning

Replies are listed 'Best First'.
Re: Re: Non-Duplicate File Names, Security, and Self Cleaning
by Petras (Friar) on Jun 12, 2003 at 01:18 UTC
    I've switched from Archive::Zip to Archive::Tar, so there's not a writeToFileHandle() method available. Where I'm running into trouble now is getting the file to the browser. CGI::Push isn't what I want to do, and
    # Send the .tar file to the browser print $q->redirect( $filename );
    can't do it. I could do
    print $q -> start_html, $q -> a ( "$filename", $filename ), $q -> end_html;
    but if I could avoid the whole new page thing I'd like to. Any ideas?
    Cheers!
    -P
    Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

    -Howard Aiken
        Actually I've figured out how to send the file. Now I'm trying to figure out how multi-part file headers work so I can send the file and make a just-in-case "Click here if the file does not start downloading automatically" page all from one script. Thanks for the link
        Cheers!
        Petras
        Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

        -Howard Aiken