# Dialog to select local directories with Genie.jl

**URL:** <https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996>\
**Category:** Specific Domains\
**Tags:** webapps, genie\
**Created:** [December 19, 2024, 5:29pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996 "2024-12-19T17:29:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheHedgehog2000](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@TheHedgehog2000](https://discourse.julialang.org/u/TheHedgehog2000)\
**Post date:** [December 19, 2024, 5:29pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/1 "2024-12-19T17:29:24Z")

</div>

Using Genie, I want to include a button in a web app that, once clicked, will trigger a dialog which allows a user to select folders containing data from their local computer to upload to the web app. I can do this using Gtk but cannot see how to do it using Genie. Anyone know how? I found this component gallery, so I know how to create the button: [Component gallery - Genie](https://learn.genieframework.com/framework/stipple.jl/docs/component-gallery). Thanks.

---

<div class="post-metadata">

**Author:** ![TheHedgehog2000](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@TheHedgehog2000](https://discourse.julialang.org/u/TheHedgehog2000)\
**Post date:** [December 19, 2024, 6:38pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/2 "2024-12-19T18:38:57Z")

</div>

Better, actually, would be if the user can specify local paths to data and the data files can be loaded iteratively

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [December 19, 2024, 8:43pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/3 "2024-12-19T20:43:16Z")

</div>

You can select a folder in a platform-independent way using `pick_folder` from the [NativeFileDialog](https://github.com/JuliaGraphics/NativeFileDialog.jl/blob/master/src/NativeFileDialog.jl) package. There is also `pick_multi_file` if you want to select multiple (but not all) files in a particular folder.

---

<div class="post-metadata">

**Author:** ![g-gundam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g-gundam/32/47593_2.png) [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Post date:** [December 19, 2024, 9:55pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/4 "2024-12-19T21:55:53Z")

</div>

My guess is that you’d have to ask the Stipple.jl maintainers to see if they’d be willing to add a feature to their Uploader component to support the browser’s [directory selection feature](https://wicg.github.io/entries-api/#html-forms).

```html
    <input id="b" type="file" webkitdirectory />

```

> **[\- HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#non-standard_attributes)**
>
> elements with type="file" let the user choose one or more files from their device storage. Once chosen, the files can be uploaded to a server using form submission, or manipulated using JavaScript code and the File API.

---

<div class="post-metadata">

**Author:** ![TheHedgehog2000](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@TheHedgehog2000](https://discourse.julialang.org/u/TheHedgehog2000)\
**Post date:** [December 19, 2024, 10:30pm UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/5 "2024-12-19T22:30:18Z")

</div>

Okay thanks, will do. Perhaps this is a naive question, but is there any way, even in principle, to have the code running on a server load in files from a specified local directory? Or, would all files need to be uploaded at the same time and stored somewhere temporarily?

---

<div class="post-metadata">

**Author:** ![g-gundam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g-gundam/32/47593_2.png) [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Post date:** [December 20, 2024, 7:00am UTC](https://discourse.julialang.org/t/dialog-to-select-local-directories-with-genie-jl/123996/6 "2024-12-20T07:00:50Z")

</div>

> [@TheHedgehog2000](#):
>
> Perhaps this is a naive question, but is there any way, even in principle, to have the code running on a server load in files from a specified local directory?

That’ll work only if the server is also local and if you’ve written the server with that assumption in mind. However, if the server is NOT local (which is usually the case), **no**.
