Allow 4gb file uploads in PHP 5.4-5.5 using a work-around.

- Check for overflow in $FILE['size'] and attempt to use filesize() instead.
- Add proper error logging in critical situations.

Thanks to Daniele Di Domizio for debugging.