I'm having a problem with uploading files to my shared hosting (UnitedHosting.co.uk). For some reason it won't allow me to upload certain MP3s. When it comes to using the 'move_uploaded_file()' function, it fails. But only fails on certain MP3s. Some MP3s seem to copy fine, but others just fail when it comes to copying them across from the temp area to the server...

Here is my file upload class:
PHP Code:
<?
class FileUpload
{

    var 
$db;
    var 
$directoryPrefix;
    var 
$fileLocation;
    var 
$fileName;
    var 
$fileTmpName;
    var 
$fileType;
    
    
    
    var 
$errorMessage;



    function 
FileUpload($db$directoryPrefix)
    {
        
// Assign all the object's properties with the
        // values that were passed to the class.
        
$this->db $db;
        
$this->directoryPrefix     $directoryPrefix;
        
$this->errorMessage        "";
    
    }


    
    
// =========================================================
    // This is the processInput function
    //
    
function processInput($fileLocation$fileName$fileTmpName$fileType)
        {
            
$fileName=str_replace(" ""_",$fileName);
        
            
$this->fileLocation     $fileLocation;
            
$this->fileName            $fileName;
            
$this->fileTmpName        $fileTmpName;
            
$this->fileType            $fileType;
            
            
                
            
// If the file has no name then...
            
if (trim($this->fileName) == "")
            {
                
                
$this->errorMessage .= "The Download is required. ";    
                return 
false;
                
            
            }
            else
            {
            
                
            
                
// Checks for all MP3s
                
if (    
                        
$this->fileType == 'audio/mpeg' or
                        
$this->fileType == 'audio/x-mpeg' or
                        
$this->fileType == 'audio/mp3' or
                        
$this->fileType == 'audio/x-mp3' or
                        
$this->fileType == 'audio/mpeg3' or
                        
$this->fileType == 'audio/x-mpeg3' or
                        
$this->fileType == 'audio/mpg' or
                        
$this->fileType == 'audio/x-mpg' or
                        
$this->fileType == 'audio/x-mpegaudio' or
                        
$this->fileType == 'audio/x-mpegurl' or
                        
$this->fileType == 'audio/x-mpeg-3' or
                        
$this->fileType == 'application/vnd.rn-rn-taiko-real-mp3' or
                        
$this->fileType == 'audio/wav' or
                        
$this->fileType == 'audio/x-midi' or
                        
$this->fileType == 'music/crescendo' or
                        
$this->fileType == 'video/x-mpeg'
                        
                        
                        
)
                {
                        
                    
//--------------------------------------------------------------
                    // CHECK IF FILE EXISTS ALREADY        
                    
                    
$sql_exists "SELECT filename FROM downloads WHERE filename = '" $this->fileName "'";
                    
$result_exists $this->db->query($sql_exists);
                    
                    
                    if(
$result_exists->size() > 0)
                    {
    
                        
$this->errorMessage .=  "That Download filename already exists. ";    
                        return 
false;        
                    }

                    
//--------------------------------------------------------------
                        
                        
                    // Copy file to server
                    
if(move_uploaded_file ($this->fileTmpName$this->directoryPrefix $this->fileLocation $this->fileName) == false)
                    {
                                        
                        
$this->errorMessage .= "The Download failed to upload. " $this->directoryPrefix $this->fileLocation $this->fileName;    
                        return 
false;
                    
                    }
                    
                

                }
                else
                {
                    
$this->errorMessage .=  "The Download is not a MP3 file type. ";    
                    return 
false;
                }
            
            }
            
            
            
            return 
true;
                    
            
        } 
    
// =========================================================    
        

   
}

Here is the other code that calls the class: (its been stripped down to its basic working bits)
PHP Code:
<?
require_once 'includes/Database/MySQL.php';
require_once 
'includes/Upload/FileUpload.php';

$db = &new MySQL($host$dbUser$dbPass$dbName);
$upl = &new FileUpload($db$directory_prefix);    

// Is the page in process mode?
if ($_REQUEST['process'] == 'true')
{

$upl->processInput($downloads_directory$_FILES['file']['name'], $_FILES['file']['tmp_name'], $_FILES['file']['type']);


}

?>

<html>
<form    action="<?php echo $_SERVER['PHP_SELF']; ?>"
        method="post" enctype="multipart/form-data" > 

Choose Your Download:     
<input type="file" name="file" value="<?php echo $download_name?>" />
<input type="hidden" name="MAX_FILE_SIZE" value="<?=$downloads_maxsize;?>" />
<input type="hidden" name="process" value="true" />
<input type="submit" name="submit" value="Upload">

</form>

</html>

Is it a problem with my code? My shared hosting? On my local development area, it seems to work fine... It's only when it's live it seems to have problems... Like I said before, certain MP3s work fine but others dont.

How do I get move_uploaded_file() to show an error message so I can maybe debug that correctly? Anyone else get this type of problem?

If anyone could help me, that would be great!