I am trying to upload something using PHP and set a limit on the total size that I allow to be uploaded. I want to limit my uploads to 2MB but for some reason whenever I try
How I supposed in my previous comment, your problem is that limit of uploadable file in php.ini is less than 7MB.
So you could try to use
if ($_FILES["file"]["size"] > 0 && $_FILES["file"]["size"] < 2097152)
Consider that if you put your limit (in php.ini) to 2MB, that check could be easily written as
if ($_FILES["file"]["size"] > 0)