With the help of AutoIt tool (open source tool) we can upload by transferring the control from Selenium webdriver to AutoIt.
We need to explicitly call the AutoIt script from our program.
About AutoIT : AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting.
We need to call the AutoIt script after clicking on the upload button. Immediately after clicking on Upload button, the control should be transferred to AutoIt by the below statement which takes care of uploading the file.