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

Have a look at Sending non-html files to a browser through a script and its answers - all the stuff you need concerning Content-type headers etc. is there.

Cheers, Ben.

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

Replies are listed 'Best First'.
Re^4: Non-Duplicate File Names, Security, and Self Cleaning
by Petras (Friar) on Jun 28, 2003 at 00:54 UTC
    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
      <html> <head> <META HTTP-EQUIV="refresh" CONTENT="0;url=Other_File.tar"> </head> <body> Downloading... </body> </html>

      How it works:

      The HTML page is rendered by the browser, then the "refresh" immediately expires. The browser will then download and try to render the .tar file. Since it can't render it, the browser will ask if you want to save the file. And the HTML page will still be there.

      This technique will not work for jpeg, gif, or text files, because any browser can render those formats!

        Thanks, fglock. Of course, with all this learning about learning about learning Perl, I'm realizing I need to spend a lot of time learning things that aren't necesarily about Perl. Looks like I need to force myself through a good <meta> tutorial, a good HTTP tutorial, and a good how-the-web-works-behind-the-scenes tutorial. I don't want to admit http://java.sun.com I got into programming beyond C-64 basic, but it looks like to learn Perl well I'll need to learn a lot more about a lot of things! Reminds me of a random quote I saw at http://use.perl.org once while reading chromatic's weblog there (paraphrasing):

        Programing web pages in Perl is a lot like having sex in a bath tub. For it to be good you have to know about a lot more than bathtubs.

        Learning as I go....thanks for the answers.

        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