Inport file in input element

Hi,

I have a problem with appium. I am automating a webpage (on Chrome and Safari) with an input to import files.

I have tried different things to do it without success.

-> doc.sendKeys((new File("src/test/resources/input/document.png")).getAbsolutePath()) : this give an absolute path on my computer, not working
-> doc.sendKeys((new File("Phone/storage/emulated/0/Download/document.png")).getAbsolutePath()) : this causes an error "session deleted because of page crash"
-> also tried with pullFile from Appium, but don't know how to get an absolute path.

So, is there any solution to use sendkeys with appium like I do with Selenium? Or should I have to deal with the native file explorer of Android?

Yes, there is no way to upload files to mobile web views like it is done on a desktop