littleblu87
Technical User
I'm just learning PHP and I need some help with this script.
The purpose of this script is to hide the location of the file that's to be downloaded.
The file (test.zip) is located here: and the script (downlod.php) is located here:
The problem is that the script assumes the file to be downloaded is in directory1 with the script. So the only thing that downloads is an empty zip file.
How do I specify in the script where the test.zip file is located at? I've been researching this thing for days and I can't find anything that works. I must be terribly pathetic, lol.
The purpose of this script is to hide the location of the file that's to be downloaded.
The file (test.zip) is located here: and the script (downlod.php) is located here:
The problem is that the script assumes the file to be downloaded is in directory1 with the script. So the only thing that downloads is an empty zip file.
How do I specify in the script where the test.zip file is located at? I've been researching this thing for days and I can't find anything that works. I must be terribly pathetic, lol.
Code:
<?php
header ( "Content-type: application/zip" );
header ( "Content-Disposition: attachment; filename=test.zip" );
readfile ( 'test.zip' );
?>