Magento has a lot of core functionalities that we can we use for our project requirements. One of them has Magento 2 EE providing the custom customer attribute with the different formats like Text, File, Image (via Dropdown or Multi-select) etc.
We can use the customer image custom attribute as per our requirement but that image attribute doesn’t have the default UI Component functionality like uploading product images.
In order to achieve that functionality for customer custom attribute, we can follow the below steps.
Create directory \etc\adminhtml\routes.xml file
Create file Plugin.php with below code
Create customer.php model file under the Model directory.
{Namespace Name}\{Module_Name}\Model\Customer\Attribute\Backend
Under this directory create file File.php for Upload the attribute image.
{Namesapace}\{Module_Name}\Controller\Adminhtml\Customer\Image\
Create Upload.php action Image controller.
Under the View directory of your module, create below directory and files
view\adminhtml\ui_component\customer_form.xml.
rm -rf var/generation var/cache
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush