i have a parsing mechanism for mp3 uploads which works fine. but only for files that are under 2 mb. any file above 2mb and it returns this [COLOR=red]error message.[/COLOR][COLOR=black] i dont understand why when the file size is set to 5mb. if anyone has any ideas it would be a great help.[/COLOR]
if ($_POST[‘parse_var’] == “shopmp3”){
if (!$_FILES[‘fileField’][‘tmp_name’]) {
[COLOR=red]$error_msg = ‘<font color="#FF0000">ERROR: Please browse for an mp3 before you press submit.</font>’;
[/COLOR] } else {
$maxfilesize = 5000200; // 51200 bytes equals 50kb
if($_FILES[‘fileField’][‘size’] > $maxfilesize ) {
$error_msg = ‘<font color="#FF0000">ERROR: Your mp3 was too large, please try again.</font>’;
unlink($_FILES[‘fileField’][‘tmp_name’]);
} else if (!preg_match("/.(mp3)$/i", $_FILES[‘fileField’][‘name’] ) ) {
$error_msg = ‘<font color="#FF0000">ERROR: Your mp3 was not one of the accepted formats, please try again.</font>’;
unlink($_FILES[‘fileField’][‘tmp_name’]);
} else {
$newname=$_FILES[‘fileField’][‘name’];
$place_file = move_uploaded_file( $_FILES[‘fileField’][‘tmp_name’], “members/$id/”.$newname);
$success_msg = ‘<font color="#009900">Your mp3 has been updated, it may take a few minutes for the changes to show… please be patient.</font>’;
}
}
}