# file attachements not showing in shared notebook

**URL:** <https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873>\
**Category:** Help\
**Created:** [April 21, 2023, 7:10pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873 "2023-04-21T19:10:48Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 21, 2023, 7:10pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/1 "2023-04-21T19:10:48Z")

</div>

Hey,

I’ve created a shared but unlisted notebook which has over 100 small image files. I’m able to see and use them when logged in but not when I share the notebook (no file attachments are shown). What’s the issue?

> **[Black Canoyn](https://observablehq.com/d/a1f5605017faa4a0)**

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 21, 2023, 7:12pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/2 "2023-04-21T19:12:42Z")

</div>

perhaps I’m over some limit, as I can share a notebook with a single FA.

---

<div class="post-metadata">

**Author:** ![Cobus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/cobus/32/9670_2.png) [@Cobus](https://talk.observablehq.com/u/Cobus)\
**Post date:** [April 22, 2023, 12:25am UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/3 "2023-04-22T00:25:31Z")

</div>

I don’t think this is a problem with a limit…

When I look at the notebook, I see that the notebook code dynamically loads the file attachments (except for that last cell, which I see you added after making the notebook public (unlisted). This is the issue… when you make a notebook public, we don’t make all file attachments publicly accessible, because that might make attachments public that you did not necessarily plan to make public. Instead, we do static analysis of the code in the notebook to determine which files attachments to make public. In your case, if didn’t find any files referenced, so they weren’t made public.

The ‘fix’ would be to simply upload those again while the notebook is public.

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [April 22, 2023, 8:42am UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/4 "2023-04-22T08:42:18Z")

</div>

Unpublish your notebook (“no access”) then publish it again and the attachments should become accessible.

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [April 22, 2023, 12:35pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/5 "2023-04-22T12:35:39Z")

</div>

… I hadn’t noticed that you reference your attachments dynamically which is not (well) supported in Observable.

I recommend the following steps:

1. Go to [How To List FileAttachments Dynamically / Fabian Iwand | Observable](https://observablehq.com/@mootari/how-to-list-fileattachments-dynamically) and follow the steps under “ **Private notebooks** ” to obtain a list of your attachments.
2. Reference them in a cell as explained in the `files = { ... }` example.
3. Unpublish your notebook.
4. Publish your notebook again.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [April 22, 2023, 3:36pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/6 "2023-04-22T15:36:23Z")

</div>

To add to what @mootari said, you need to list out your files statically like the code below. Observable requires you to reference files statically so that we know which files are in use and can make them public when the notebook is made public. There’s a similar requirement for secrets and databases, and that’s why FileAttachment throws an error when you try to pass in a dynamic string.

Here’s a live example:

> **[Scrubber image animation](https://observablehq.com/@observablehq/scrubber-image-animation)**
>
> Ref. https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/6

(Eventually we’d like to make some changes to how file attachments work in Observable that would eliminate this requirement, but that change likely won’t be soon.)

```js
files = [
  FileAttachment("1500.jpg"),
  FileAttachment("1501.jpg"),
  FileAttachment("1502.jpg"),
  FileAttachment("1503.jpg"),
  FileAttachment("1504.jpg"),
  FileAttachment("1505.jpg"),
  FileAttachment("1506.jpg"),
  FileAttachment("1507.jpg"),
  FileAttachment("1508.jpg"),
  FileAttachment("1509.jpg"),
  FileAttachment("1510.jpg"),
  FileAttachment("1511.jpg"),
  FileAttachment("1512.jpg"),
  FileAttachment("1513.jpg"),
  FileAttachment("1514.jpg"),
  FileAttachment("1515.jpg"),
  FileAttachment("1516.jpg"),
  FileAttachment("1517.jpg"),
  FileAttachment("1518.jpg"),
  FileAttachment("1519.jpg"),
  FileAttachment("1520.jpg"),
  FileAttachment("1521.jpg"),
  FileAttachment("1522.jpg"),
  FileAttachment("1523.jpg"),
  FileAttachment("1524.jpg"),
  FileAttachment("1525.jpg"),
  FileAttachment("1526.jpg"),
  FileAttachment("1527.jpg"),
  FileAttachment("1528.jpg"),
  FileAttachment("1529.jpg"),
  FileAttachment("1530.jpg"),
  FileAttachment("1531.jpg"),
  FileAttachment("1532.jpg"),
  FileAttachment("1533.jpg"),
  FileAttachment("1534.jpg"),
  FileAttachment("1535.jpg"),
  FileAttachment("1536.jpg"),
  FileAttachment("1537.jpg"),
  FileAttachment("1538.jpg"),
  FileAttachment("1539.jpg"),
  FileAttachment("1540.jpg"),
  FileAttachment("1541.jpg"),
  FileAttachment("1542.jpg"),
  FileAttachment("1543.jpg"),
  FileAttachment("1544.jpg"),
  FileAttachment("1545.jpg"),
  FileAttachment("1546.jpg"),
  FileAttachment("1547.jpg"),
  FileAttachment("1548.jpg"),
  FileAttachment("1549.jpg"),
  FileAttachment("1550.jpg"),
  FileAttachment("1551.jpg"),
  FileAttachment("1552.jpg"),
  FileAttachment("1553.jpg"),
  FileAttachment("1554.jpg"),
  FileAttachment("1555.jpg"),
  FileAttachment("1556.jpg"),
  FileAttachment("1557.jpg"),
  FileAttachment("1558.jpg"),
  FileAttachment("1559.jpg"),
  FileAttachment("1560.jpg"),
  FileAttachment("1561.jpg"),
  FileAttachment("1562.jpg"),
  FileAttachment("1563.jpg"),
  FileAttachment("1564.jpg"),
  FileAttachment("1565.jpg"),
  FileAttachment("1566.jpg"),
  FileAttachment("1567.jpg"),
  FileAttachment("1568.jpg"),
  FileAttachment("1569.jpg"),
  FileAttachment("1570.jpg"),
  FileAttachment("1571.jpg"),
  FileAttachment("1572.jpg"),
  FileAttachment("1573.jpg"),
  FileAttachment("1574.jpg"),
  FileAttachment("1575.jpg"),
  FileAttachment("1576.jpg"),
  FileAttachment("1577.jpg"),
  FileAttachment("1578.jpg"),
  FileAttachment("1579.jpg"),
  FileAttachment("1580.jpg"),
  FileAttachment("1581.jpg"),
  FileAttachment("1582.jpg"),
  FileAttachment("1583.jpg"),
  FileAttachment("1584.jpg"),
  FileAttachment("1585.jpg"),
  FileAttachment("1586.jpg"),
  FileAttachment("1587.jpg"),
  FileAttachment("1588.jpg"),
  FileAttachment("1589.jpg"),
  FileAttachment("1590.jpg"),
  FileAttachment("1591.jpg"),
  FileAttachment("1592.jpg"),
  FileAttachment("1593.jpg"),
  FileAttachment("1594.jpg"),
  FileAttachment("1595.jpg"),
  FileAttachment("1596.jpg"),
  FileAttachment("1597.jpg"),
  FileAttachment("1598.jpg"),
  FileAttachment("1599.jpg")
]

```

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 24, 2023, 5:04pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/7 "2023-04-24T17:04:39Z")

</div>

Thanks for the example. I’ve implemented as you suggested but I’m getting a bunch of `Error: Unable to load file: 1539.jpg` errors when I share the notebook (unlisted). Any ideas?

---

<div class="post-metadata">

**Author:** ![Cobus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/cobus/32/9670_2.png) [@Cobus](https://talk.observablehq.com/u/Cobus)\
**Post date:** [April 24, 2023, 5:23pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/8 "2023-04-24T17:23:54Z")

</div>

Looks like you figured it out 🙂 You are missing the `@1` for some of those files.

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 24, 2023, 5:33pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/9 "2023-04-24T17:33:00Z")

</div>

Well some of the files were showing errors, but only after I tried to 'Insert into notebook", otherwise they looked okay in the FA panel. However, if I opened the notebook in incognito and opened the FA panel, I’d see a few files showing errors.

Before I tried sharing the notebook all of the files were fine, so I’m not sure what is happening when I share, but that seems to be when the error occur.

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 25, 2023, 3:00pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/10 "2023-04-25T15:00:05Z")

</div>

Here’s another one that works when not shared but shows errors with the file attachments when shared [https://observablehq.com/d/571c91d924d6c7a5](https://observablehq.com/d/571c91d924d6c7a5)  
It’s working now (unshared) but this is what I see when shared.

 ![Screenshot 2023-04-25 at 7.57.40 AM](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/4/4b51db3d2202636fca2dbca6836007c74d6d652f.png)

---

<div class="post-metadata">

**Author:** ![Cobus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/cobus/32/9670_2.png) [@Cobus](https://talk.observablehq.com/u/Cobus)\
**Post date:** [April 25, 2023, 4:34pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/11 "2023-04-25T16:34:02Z")

</div>

Very strange. Could you share it again so that we can take a look at it?

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 25, 2023, 4:44pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/12 "2023-04-25T16:44:13Z")

</div>

Yes, just shared it, thanks!

---

<div class="post-metadata">

**Author:** ![Cobus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/cobus/32/9670_2.png) [@Cobus](https://talk.observablehq.com/u/Cobus)\
**Post date:** [April 25, 2023, 5:09pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/13 "2023-04-25T17:09:58Z")

</div>

Thanks. Looking into it.

---

<div class="post-metadata">

**Author:** ![camdecoster](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/camdecoster/32/6587_2.png) [@camdecoster](https://talk.observablehq.com/u/camdecoster)\
**Post date:** [April 25, 2023, 5:52pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/14 "2023-04-25T17:52:05Z")

</div>

Hello! I’m Cam at Observable and I’m trying to dig into this issue. Just to confirm, after listing the files as suggested by Fabian and Mike, did you make the notebook private and then share it again?

---

<div class="post-metadata">

**Author:** ![mbrownshoes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbrownshoes/32/423_2.png) [@mbrownshoes](https://talk.observablehq.com/u/mbrownshoes)\
**Post date:** [April 25, 2023, 5:57pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/15 "2023-04-25T17:57:10Z")

</div>

> [@mbrownshoes](#):
>
> [BC testing transparent / Hakai Institute | Observable](https://observablehq.com/d/571c91d924d6c7a5)

Yes, I tried a few times with this notebook [https://observablehq.com/d/571c91d924d6c7a5](https://observablehq.com/d/571c91d924d6c7a5)

---

<div class="post-metadata">

**Author:** ![camdecoster](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/camdecoster/32/6587_2.png) [@camdecoster](https://talk.observablehq.com/u/camdecoster)\
**Post date:** [April 25, 2023, 5:58pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/16 "2023-04-25T17:58:30Z")

</div>

Thank you! I’ll follow up when I have some more information.

---

<div class="post-metadata">

**Author:** ![camdecoster](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/camdecoster/32/6587_2.png) [@camdecoster](https://talk.observablehq.com/u/camdecoster)\
**Post date:** [April 25, 2023, 9:36pm UTC](https://talk.observablehq.com/t/file-attachements-not-showing-in-shared-notebook/7873/17 "2023-04-25T21:36:43Z")

</div>

It seems that your notebook attachments are now all showing up. Is that what you’re seeing as well?

As an update, it appears that some changes we made recently have added some latency to publishing/unpublishing and this resulted in some timeouts which allowed your notebook to get into an odd half published state (as far as attachments go). I’m working on a fix so that this won’t happen again. Sorry for the disruption!
