fixes #6280 Validation needed for upload plugin

Fixed the issue and pushed the code for review, please check it.