{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreictzx5zsdwch3acrx24hqhujppldtlxhrphdzqncmfc7wa4ivcf7e",
    "uri": "at://did:plc:yrn4rbgwenb6lfhhzjegbtnc/app.bsky.feed.post/3mft2vk3z6272"
  },
  "path": "/t/topic/11774#post_2",
  "publishedAt": "2026-02-23T10:17:11.000Z",
  "site": "https://discourse.flathub.org",
  "textContent": "> I’m using `flatpak-spawn --sandbox` as a sandbox in my project to run user-provided NWJS code. Obviously, I need to expose the user-selected directory to the sub-sandbox.\n>\n> Initially, I used `xdg-portal + FileChooser` to request the user to select a directory, which did expose the directory to my app at `/run/user/1000/doc`.\n>\n> Then I tried exposing files to the sub-sandbox using the `--sandbox-expose-path=` parameter, but that didn’t work.\n>\n> [Screenshot]\n>\n> The only solution I can think of is to directly request access to the user’s entire home directory in the app’s permissions using `--filesystem=home`. This would provide all of the user’s files to the app, including the user-selected directory in the `~` area, thus directly exposing them to the sub-sandbox.\n>\n> However, directly requesting access to the user’s entire home directory isn’t a good idea either. Is there any way to solve this problem?\n\nGoogle Translate",
  "title": "如何为子沙箱暴露用户选择的文件?"
}