Digicoder
11-18-2007, 03:58 AM
I've yet again found a problem with my script. the script bellow is set to allow processions if the mime type of a file is equal to a .mp3 or a .wav file but no matter how a change it I still throws my set error and stops the process.
$mp3 = array( 'audio/x-mpegurl', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/x-mpeg')
if($_SESSION['permix']['a_podz'] == 1)
{
if ($podz->validate())
{
$podz->freeze();
if(isset($_POST['pid']))
{
$podz->process('podz_rocessing', false);
}
if (isset($_GET['sub']) && $_GET['sub'] == 'upload' and !isset($_POST['pid']))
{
// Uploading/Resizing Script
$ext = explode('.', basename($_FILES['pod_file']['name'])); // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php
$file_ext = '.'.$ext[1];
$url = $_FILES['pod_file']['name']; // Set $url To Equal The Filename For Later Use
if($_FILES['pod_file']['type'] == $mp3 || $_FILES['pod_file']['type'] == 'audio/x-wav')
{
$copy = copy($_FILES['pod_file']['tmp_name'], "$pdir" . $new_name . $file_ext); // Move Image From Temporary Location To Permanent Location
if($copy)
{ // If The Script Was Able To Copy The Image To It's Permanent Location
$podz->process('podz_processing', false);
$link = "$pdir" . $new_name . $file_ext;
}
else
{
echo'Your podcast did not go through. Tell CTB that it wasn\'t copied';
}
}
else
{
print '<font color="#FF0000">ERROR: Wrong filetype (has to be a .wav or .mp3. Yours is '; // Error Message If Filetype Is Wrong
print $file_ext; // Show The Invalid File's Extention
print '.</font>';
}
}
}
else
{
define('PAGE_TITLE', 'ACP - Podcasts');
define('BODY_FORM','width="1000" cellpadding="0" cellspacing="0" height="1" bordercolor="#000000" style="main" border="0"');
include_once('includes/Header.php');
include_once('includes/Hmessage.php');
$podz->display();
include_once('includes/Fmessage.php');
include_once('includes/footer.php');
}
}
can any one help me out on this one?
thanks.
$mp3 = array( 'audio/x-mpegurl', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/x-mpeg')
if($_SESSION['permix']['a_podz'] == 1)
{
if ($podz->validate())
{
$podz->freeze();
if(isset($_POST['pid']))
{
$podz->process('podz_rocessing', false);
}
if (isset($_GET['sub']) && $_GET['sub'] == 'upload' and !isset($_POST['pid']))
{
// Uploading/Resizing Script
$ext = explode('.', basename($_FILES['pod_file']['name'])); // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php
$file_ext = '.'.$ext[1];
$url = $_FILES['pod_file']['name']; // Set $url To Equal The Filename For Later Use
if($_FILES['pod_file']['type'] == $mp3 || $_FILES['pod_file']['type'] == 'audio/x-wav')
{
$copy = copy($_FILES['pod_file']['tmp_name'], "$pdir" . $new_name . $file_ext); // Move Image From Temporary Location To Permanent Location
if($copy)
{ // If The Script Was Able To Copy The Image To It's Permanent Location
$podz->process('podz_processing', false);
$link = "$pdir" . $new_name . $file_ext;
}
else
{
echo'Your podcast did not go through. Tell CTB that it wasn\'t copied';
}
}
else
{
print '<font color="#FF0000">ERROR: Wrong filetype (has to be a .wav or .mp3. Yours is '; // Error Message If Filetype Is Wrong
print $file_ext; // Show The Invalid File's Extention
print '.</font>';
}
}
}
else
{
define('PAGE_TITLE', 'ACP - Podcasts');
define('BODY_FORM','width="1000" cellpadding="0" cellspacing="0" height="1" bordercolor="#000000" style="main" border="0"');
include_once('includes/Header.php');
include_once('includes/Hmessage.php');
$podz->display();
include_once('includes/Fmessage.php');
include_once('includes/footer.php');
}
}
can any one help me out on this one?
thanks.