Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by Petras (Friar)
on Jun 12, 2003 at 01:18 UTC ( #265243=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re: Re: Non-Duplicate File Names, Security, and Self Cleaning
Select or Download Code
Re: Re: Re: Non-Duplicate File Names, Security, and Self Cleaning
by benn (Priest) on Jun 13, 2003 at 16:00 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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://265243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2014-09-21 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls