billr wrote:
Greg,
This is the way it should look:
<?php
$filename = "AmazingGrace.bww";
header("Content-Length: " . filesize($filename));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=AmazingGrace.bww');
readfile($filename);
?>
Then save that as AmazingGrace.php When someone clicks on the .php link, the .php file willshift everythinbg to your bww file for download. Both cases of the fiile name should be the same inside the .php file.
It is working great for me.
I really appreciate your help Bill. And I've followed your instructions closely but, I either missing something or ...
This is my php code:
<?php
$filename = "AmazingGrace.bww";
header("Content-Length: " . filesize($filename));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=AmazingGrace.bww');
readfile($filename);
?>
But, this is what I'm getting now:
Warning: filesize(): Stat failed for AmazingGrace.bww (errno=2 - No such file or directory) in /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php:4) in /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php:4) in /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php:4) in /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php on line 6
Warning: readfile(AmazingGrace.bww): failed to open stream: No such file or directory in /home/content/O/l/y/OlyHighPB/html/bprtunes/BasicFive/AmazingGrace.php on line 8
What the heck did I do now?
Greg