# Problem with parsing mechanism

**URL:** <https://forum.kirupa.com/t/problem-with-parsing-mechanism/297638>\
**Category:** Uncategorized\
**Created:** [October 6, 2009, 12:02pm UTC](https://forum.kirupa.com/t/problem-with-parsing-mechanism/297638 "2009-10-06T12:02:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leewebber](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@leewebber](https://forum.kirupa.com/u/leewebber)\
**Post date:** [October 6, 2009, 12:02pm UTC](https://forum.kirupa.com/t/problem-with-parsing-mechanism/297638/1 "2009-10-06T12:02:04Z")

</div>

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\>’;  
}  
}  
}
