add validation of php upload error

Add validation method of php upload errors (http://www.php.net/manual/features.file-upload.errors.php)