You'd better check $_FILES structure and values throughly. The following code cannot cause any errors absolutely.
php.net