andrechance Posted July 24, 2007 Share Posted July 24, 2007 I would like to use a PHP script to initiate a file DOWNLOAD (download, not upload.) My motivation is to hide the full path names from the users -- who might be tempted to figure out the file naming convention and type those names directly in their browsers, instead of going through the regular website pages (which check for authentication.) Anyway, I noticed that the PHP Freaks Code Library pages have exactly such a thing: a Download button. For example, http://www.phpfreaks.com/quickcode/Page-Counter/73.php offers a Download button. I looked at the source file, and saw that it contains: <form method="post" action="/quickcode.php"> <input type="hidden" name="cmd" value="doDownload" /> <input type="hidden" name="quickcode_id" value="73" /> Choose Type: <select name="type"><option value="tar">Linux (Tarball)</option><option value="zip">Windows (Zip File)</option> </select> <input type="submit" value="Download" onclick="if ( !window.confirm( 'By downloading this file, you accept it at your own risk. PHPFreaks does not guarantee this code or what it will do to your system!' ) ) { return false; };" /> </form> It looks like the "quickcode.php" script works together with the above form to initiate a file download... What does such a script consist of? Thanks!! Quote Link to comment Share on other sites More sharing options...
andrechance Posted July 24, 2007 Author Share Posted July 24, 2007 BTW, any other suggestion on how to hide file names is welcome! But, it seems to me, letting PHP manage the downloads (instead of offering HTML links that could be read) is a way to take care of that. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 24, 2007 Share Posted July 24, 2007 http://www.phpfreaks.com/forums/index.php/topic,148095.0/topicseen.html That should help. Quote Link to comment Share on other sites More sharing options...
fert Posted July 24, 2007 Share Posted July 24, 2007 http://www.phpfreaks.com/forums/index.php/topic,95433.0.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.