Store files in a tree and rename to shasum

To future-proof logseq, I would:

  • rename files to their shasum, so that we avoid managing strange names (spaces, weird characters, …)
  • store them in a tree indexed at least with the first two characters, maybe with a depth of 3. The assets folder could get very crowded in the long run

Renaming files like this is a terrible idea. A lot of folks use Logseq alongside Obsidian, and you’d break all wikilinks for these people with this change.

For the assets folder, I’m wondering whether there might be some better option where you could manage this hierarchy from within Logseq itself.

Ok I get it, I didn’t have the details about Obsidian internals.

However, I’d find a way of spreading files more in the assets folder, to avoid having thousands of them in a single directory, which would probably put pressure on the filesystem.

Confluence does exactly that for the that same reason of a limited allowed number of attachments/files in a directory. tree structure with file renames

What if we again borrowed from Obsidian and allowed manual creation of subfolders in the assets folder at least?

This is already possible

By the way, renaming with a hash would allow for deduplication of files, which could be useful.

Oh, just tested… Indeed it is. This is great. In that case, I vote against the above proposal. I’d much rather decide myself what folders I want stuff to reside in.

The matter with a tool like logseq is to hide the underlying structure and show a high level view of the contents. When uploading a file or an image it defaults to /assets and you cannot choose where to put it.
Of course you can sideload assets and link them in the files, but that’s a really bad feature both in terms of usability and risks of breaking things in many different and maybe subtle ways.

At least, destination folder should be a choice available in the UI

1 Like

Moreover, the .edn file is created in the /assets folder anyway (just checked) and I don’t want to know what would happen in case of name clashes @hkgnp

agreed. at least a configuration option might be useful.

I’d assume 95% of attached image use cases are: copy an image and paste it into a logseq page, which dumps it into an assets folder. that’s where the hash-file-name might prove to be useful