Does not matter which OS or which browser your dealing with. The rule is the same. You can use XPath element locator technique to locate the element. And once that is done, you can use sendKeys() with path to file, to upload the files. Code below.
// Locating XPath of the element(using Firebug)
WebElement elem = driver.findElement(By.xpath("//input[@type='file']"));
// Mention the path of file to do the upload
elem.sendKeys("C://path/To/File.txt")