Condition set on File Upload not working as it should