# Getting file dialog in Blink

**URL:** <https://discourse.julialang.org/t/getting-file-dialog-in-blink/118480>\
**Category:** Web Stack\
**Tags:** blink\
**Created:** [August 22, 2024, 11:47am UTC](https://discourse.julialang.org/t/getting-file-dialog-in-blink/118480 "2024-08-22T11:47:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [August 22, 2024, 11:47am UTC](https://discourse.julialang.org/t/getting-file-dialog-in-blink/118480/1 "2024-08-22T11:47:18Z")

</div>

In connection with building a [GUI for PkgTemplates](https://discourse.julialang.org/t/too-much-time-on-my-hands/117816/23), I’d like to have a file/directory picker. The whole thing is Blink.jl → `Electron` → `HTML+JS` based.

`<input>` tag doesn’t work as I need it, as it doesn’t return the full path (security limitation).

I’ve tried to use the `dialog` module, as the web recommends for `Electron`, but don’t get it to work:

```julia
<button onclick="openFile()">Select File</button>
// ..
<script>
const {dialog} = require('electron').remote;

function openFile() {
// alert("Hello! I am an alert box!!");
  console.log(dialog.showOpenDialog({properties: ['openFile']}));
}
</script>

```

On clicking the button, nothing happens (or alert shown, if I uncomment it). Any ideas?

A workaround using NativeFileDialog.jl should be possible, but I’d just prefer to avoid an additional roundtrip through a Julia code.
