Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get input file path using NeutralinoJS

How do I get input file path using NeutralinoJS?

My Code:

<input type="file" id="inputFile">
const inputFilePath = document.getElementById('inputFile').files[0].path
console.log(inputFilePath)
like image 712
Shura16 Avatar asked Oct 21 '25 00:10

Shura16


1 Answers

I don't think browsers allow you to get file paths.

You could use the file picker API instead os.showDialogOpen(DialogOpenOptions): https://neutralino.js.org/docs/api/os#osshowdialogopendialogopenoptions

<button onclick="onFileUpload()">
async onFileUpload () {
  let response = await Neutralino.os.showDialogOpen({
    title: 'Select a file'
  })
  console.log(`You've selected: ${response.selectedEntry}`)
}
like image 55
AlekseyHoffman Avatar answered Oct 23 '25 13:10

AlekseyHoffman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!