This has been answered a few times on here but here is what you need to do. Find the input for the file upload and use send keys to the file path. You do not interact with the ui file upload dialog box.
ex:
string filePath = "c:Filesfile.png";
driver.FindElement(By.XPath("//input[@type='file']")).SendKeys(filePath);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…