reading files client-side only

I wish I was able to pick a local file without having to upload it.

This would make the PG&E notebook easier to use and more privacy friendly: anybody could open it and select a local file without having to upload the data to observable.

Just a suggestion. As this is something I can do rather easily with a and JS.

Welcome to the forums @steren! It is indeed possible (even easy and fun) to make something like what you describe on Observable, and I quickly hacked together a “client-side only” fork of the notebook here:

Edit: It makes use of @jashkenas’s very convenient file input cell mentioned in @mcmcclur’s post below.

2 Likes

There’s the file upload input.

Now, that is a full service response! :+1:

3 Likes

Hi @steren. Using the file client-side only is, in fact, the default behavior. The file will only be uploaded if you click Fork to save your changes.

1 Like

Wow, that’s actually a great default! However, it was not obvious from the File Attachments notebook nor from the file attachment UI. I did notice the little “lock” icon that appeared over the replacement file when I was testing it out. I hovered my mouse cursor over it in the hopes of getting a tooltip that would clarify what it meant but got nothing. Thus I assumed it meant that the file was uploaded but set to “private” somehow since that’s what I associated the lock icon with on the site.

1 Like

I’ll file an issue to make the UI more self-describing. I agree it’s not as obvious as it should be!

(Somewhat off-topic, but the lock icon tells you whether the file is private or public. Even when a file is uploaded to a public notebook, it remains private until you publish the notebook. A file that is not saved/uploaded is necessarily also private, and so shows a lock icon. I don’t think we have any special icon for files that are not yet uploaded, but perhaps we should!)

1 Like

Oh that’s great.
In that case, yes I think there is a UX issue, as you have seen, the current UX really led me to think I was “uploading” my file, and that it was going to “replace” the existing one. I assume that if I did not fork the notebook, my file might be deleted, but I dd not assume it was client side.