Great, I'll give that a shot. Cheers.
I want to allow people to download .zips and stuff, not HTML pages. I can do all of the vBulletin checks and stuff, I just didn't know how to send files like that.
Thanks again. If I have problems using the script, I'll know where to look
EDIT: I have built a script using the above info, but when the file is downloaded it is always 0 bytes in length. This is the script:
PHP Code:
if ($_REQUEST['do'] == "download")
{
$file = $_REQUEST['file'];
$filetype = $_REQUEST['type'];
$filename = $file . "." . $filetype;
$file_location = getcwd() . "/band_files/" . $filename;
$filesize = filesize($file_location);
header ("Content-Type: audio/mpeg");
header ("Content-Length: ".$filesize);
header ("Content-Disposition: attachment; filename=\"$filename\"");
readfile($filepath);
}
It doesn't work properly when using file_get_contents() in place of readfile() either. Anyone know what's wrong?