PC Nerd Posted September 24, 2007 Share Posted September 24, 2007 Hi guys. Ive got the following code. however its telling me to download itself ( download.php), and not the file in the $_GET data... <?php header("Content-type: application/".$_GET['type'].""); header("Content-Disposition: attachment; ".$_GET['file'].";"); readfile("$_GET['file']"); ?> is this the correct code or do i need to try something different? The data type will change. at the moment the data types are as following: .py, .java, .zip, .js( not sure). We may also be downloading .exe etc. *its a programmign website. Thanks Quote Link to comment Share on other sites More sharing options...
hvle Posted September 24, 2007 Share Posted September 24, 2007 do you have any space or line before <?php ? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted September 24, 2007 Author Share Posted September 24, 2007 none..... <?php header("Content-type: application/".$_GET['type'].""); header("Content-Disposition: attachment; ".$_GET['file'].";"); #readfile("$_GET['file']"); ?> thats the entire document Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted September 24, 2007 Author Share Posted September 24, 2007 bump 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.