| View previous topic :: View next topic |
| Author |
Message |
Deirdre Czarina Emeritus

Joined: 10 Nov 2004 Posts: 13024 Location: Camp Cooper
|
Posted: Fri Oct 22, 2010 1:57 am Post subject: website anomaly |
|
|
Boy howdy— If anyone can tell me why the php download script isn't working for my commercial demo, I'd be much obliged.
DBCooperSpots.mp3 is the file.
Here's the php Script.
| Code: |
<?php
$mp3 = $_GET['mp3'];
$file = '/home/content/D/e/i/DeirdreB/html//VA/DBCooperVO/audio/'.$mp3;
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
if ( file_exists($file) ) {
header("Pragma: public");
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/mp3");
header('Content-Disposition: attachment; filename="'.$mp3.'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($file));
set_time_limit(0);
@readfile($file) OR die("<html><body OnLoad=\"javascript: alert('Unable to read file!');history.back();\" bgcolor=\"#F0F0F0\"></body></html>");
exit;
} else {
die("<html><body OnLoad=\"javascript: alert('File not found!');history.back();\" bgcolor=\"#F0F0F0\"></body></html>");
}
?>
|
Here's the call plus stuff for the graphic link:
| Code: | | <a href="demo.php?mp3=DBCooperSpots.mp3"> <img src="images/download.gif" width="100" height="18" border="0" id="Image7" onmouseover="MM_swapImage('Image7','','images/downloadRO.gif',1)" onmouseout="MM_swapImgRestore()" /></a> |
I don't get it— it works for the other 2 calls. _________________ DBCooperVO.com
IMDB |
|
| Back to top |
|
 |
brianforrester Backstage Pass

Joined: 30 Jul 2005 Posts: 492 Location: Vancouver, British Columbia, Canada
|
Posted: Sun Oct 24, 2010 5:06 pm Post subject: |
|
|
Hey Deebs,
I just checked out your site and it looks like it's working again?? Or is my browser playing nice where others might not be?
Hope you're well!
Cheers, _________________ Brian Forrester Voice Overs
www.brianforrester.com
brian@brianforrester.com
778.668.5715 |
|
| Back to top |
|
 |
Deirdre Czarina Emeritus

Joined: 10 Nov 2004 Posts: 13024 Location: Camp Cooper
|
Posted: Sun Oct 24, 2010 5:25 pm Post subject: |
|
|
Sorry I didn't post an update to this— Anthony Mendez identified my script error and fixed it.
Yay!
Thank you for your concern.
 _________________ DBCooperVO.com
IMDB |
|
| Back to top |
|
 |
anthonyVO 14th Avenue
Joined: 09 Aug 2005 Posts: 1470 Location: NYC
|
Posted: Sun Oct 24, 2010 6:20 pm Post subject: |
|
|
I smacked the code like an old tube TV and BOOM! It worked.
If it happens again, I'll break the knobs off and use some pliers to change the channels.
-Anthony |
|
| Back to top |
|
 |
|