Automatic image and attachment management (note-level attachment management)

OP’s question seems (to me at least) to be more about moving some but not all notes from a folder and taking their attachments with them.

The problem I see with this is what happens if you have Note A and Note B both referencing an image in the local attachments folder, and you move Note A but leave Note B in place. Do you leave the image in the local attachments folder and update Note A point to the image in the “old” location? Or do you move the image and then update Note B to point to the image in the “new” location? Or do you copy the image to both locations?

Then there’s the issue of how are existing user workflows handled? For example, my workflow doesn’t need this capability at all, because I either add images to a global folder or to a source-specific folder, so the images will always be attached to their source which is itself in the enclosing folder. So adding this would require either (a) adding a configuration item that increases complexity or (b) changing existing behavior which breaks my own workflow.

I suspect adding something like this opens the door to a lot of edge case complexity and it is probably preferable to keep Obsidian simple, especially since there’s currently a straightforward (but admittedly mildly frustrating for the individual who wants this) manual workaround.

But that’s just my thought.

2 Likes

Yeah, I think there is a general problem for markdown and images and other attachments that is not limited to this app. Html can handle this by saving all in one file but on the other hand html is not as minimal as markdown. Maybe a mid-way solution for images could be possible, as images should be considered minimal in 2021.

@ davecan
You mentioned the case that “Note A and Note B both reference an image in the local attachments folder”, and I think if every note has option to have its dedicated “*_attachments” folder and automatically managed by the note tool, this problem should be solved. Common reference might save some disk space but I don’t think this can be a big deal for nowadays PC hard disk size.

1 Like

if every note has option to have its dedicated “*_attachments” folder

I would uncheck this option with extreme prejudice lol. It simply does not fit at all in my workflow and I’ve never heard of it in any other note tool.

That said, its up to the devs and the community whether adding an option for this is warranted. I suppose it could become just another dropdown in the Default location for new attachments setting.

Out of curiosity, what is your real world use case for this feature?

Yes, I’d suggest this becomes another drop down option in the “Default location for new attachments” as you mentioned.

The use case can be as below:

  • Note can be started quickly at one place but later on be moved to some other places during its life span
  • A lot of screenshot and file attachments can be added to note during updates of the note in its life span
  • If attachments go with note, these attachments are always “attached” to the note no matter how I move them and I can easily locate all of them in the Finder / File Explorer then zipped to share with others who don’t have Obsidian or for other purpose like backup
  • It will also be easier to remove some notes along with attachments quickly in the Finder / File Explorer without checking reference relationships in the Obsidian tool
  • Also it naturally avoids large amount of orphan attachments (i.e. quick screenshots, PDFs or other files) when notes are deleted
10 Likes

I think this would go well with this suggestion, if it gets implemented.

1 Like

Yes, I also think so as long as the attachment folder is kept sync with note (i.e. rename, move, copy …) automatically.

I think this is showing a difference in the overarching strategy behind how different user personas use Obsidian.

@WhiteNoise You may already have these personas developed but if not there seem to be at least two user personas at play here: one that wants a more hierarchical approach for knowledge/reference management, and one that wants a more fluid note-focused approach for Zettelkasten-style knowledge development with attachments relatively decoupled from notes. (I’m in the latter, but do also store some reference/cheatsheet type info in the same vault, but would not want the described function to become a global default for all of my notes)

I may be misunderstanding the persona here, and I’m sure there’s other personas as well.

This could be an interesting feature for certain personas as long as it doesn’t unduly disrupt workflows for the others.

But I do think it could be worthwhile for Obsidian to provide some guidance up front on the overall strategies that each option supports or inhibits. And perhaps some guidance on common settings / plugins / themes to use for users who are switching from Noteplan, Bear, Roam, etc. to make the experience feel more like their prior app.

@greatqs

This can be done by the plugin
consistent-attachments-and-links

But if you use obsidian Sync now it does not work correctly with it - Obsidian Sync. Spontaneous deletion of pictures - #15 by friendlmickle.

I make issue - Обновление кеша ссылки - конфликтует с работой obsidian Sync · Issue #8 · dy-sh/obsidian-consistent-attachments-and-links · GitHub and hope the developer will fix this soon. I like the plugin very much!

1 Like

@friendlmickle Hi, I just checked plugin github link but it seems there is no fix on the sync issue as you mentioned. Do you know whether this is currently any solution to have this attachment folder renaming feature while keeping compatible to native sync?

@greatqs Hi! No, I don’t know of such a solution. Unfortunately.

I think an obsidian native solution for moving attachments with notes would be really useful for a large group of users. The solution by @dy-sh is intelligent, but you also have to give up some Obsidian smartness.

It would be a great addition to Obsidian if a note could be moved to another folder and the attachments would keep their same relative position. In my case, I store attachments in an ‘assets’ subfolder of the folder in which the note resides. It would be great if, when I move a note to another folder, its attachments would move with it to the assets folders of that new folder.

14 Likes

would also love this feature

Z

This would be a really useful feature.

My note-taking is rather image heavy, so moving notes with lots of images, say from an inbox folder to its permanent filed location, can be quite tedious and error prone.

Often, I will quickly make a note in a default folder with the hotkey, add some text and images, then move the note to its propper location with the “Move current file to another folder” in the command palette.

It would be very useful if there was a second command in the palette, lets say “Move current file to another folder, and bring all linked images also in the same folder/attachment folder with it”.

The key here would be to avoid moving any attachments that are linked in that are already in their correct location in a different folder.

1 Like

+1 Follow

My use case: we share a knowledge base in our team using git. Most notes start out in a private folder, until they’re mature enough to be shared (i.e. moved to the general folder).
Most of our notes are using a number of images, which are automatically stored under an “attachments” subfolder of the current directory.

We want to be able to easily move notes/folders around in the vault, while keeping them portable as a unit (i.e. images are shared with the note when you e.g. zip a folder and send it to someone).

Currently we can easily move the “attachments” folder with the notes we move.

However, when there is e.g. 4 notes in a folder with images, and we want to move 1 note with its images. We need to start figuring out which images belong to which note.

Having 1 subfolder per note is not an option, that’s too cluttered.

In the meantime I will check out @friendlmickle 's suggestion (obsidian-consistent-attachments-and-links)

I think the plugin could do the following:

  • When moving a note, the setting 'Default location for new attachments` is honored, moving the attachments and creating a host directory if necessary.

If other notes point to the same attachments

A Modal is shown to confirm moving the attachments:


Do you also want to move the (5) attachments?

There are currently (2) links pointing to the attachments.

Don’t ask again [Move][Cancel]


I would personally click on don’t ask again.

2 Likes

Apple notes does this and it’s very confusing. If you drop a file or folder into a note it embeds it into the note (instead of linking to it). It’s one of the reasons I stopped using Apple Notes (along with it deleting two weeks of notes in an iCloud bug)

obsidian-attachment-management can be used as an alternative consistent-attachments-and-links (buggy)

This iS an old post, I know, but it’s still an ongoing requirement currently not handled in Obsidian natively.
To answer your question “why would attachments belonging to a note have a dedicated folder sitting along the note file”.

Because I don’t mind it, it help with my paranoia of notes getting lost because Obsidian seems to me (coming from Evernote) as a fragile geeky swiss-nife plain-text notes on steroids.

Anyhow, the IMPORTER plugin does exactly this - imports Evernote notes and puts attachments for each individual note from Evernote in a dedicated folder with the name matching the note name. So this is matter of consistency.

What am I supposed to do now? If I select any of the 3 only options available to manage attachments, it is going to be inconsistent with the original import.

To be honest, the only reason I went down into the rabbit hole of this hole thing is because I read somewhere - deleting notes will not remove attachments from the database… BAAM! … I need a plugin, do I trust it, what about if things run bad with REMOTELY SAVE and doing things from Android or iPhone, who knows what may happen, so I realized where am I going to look if there are issues that need manual fixing if things break. If I need to do that, where am I going to look for it.

So that is how that whole trip started for me.

I was looking for a smooth Evernote transition, which I got, import worked fine. And I could just carry on start using Obsidian without understanding how it works and later end with a mess like some people do when attempting to move manually attachments between folders.

Whatever the solution is, for a user coming from Evernote, I would expect:

  1. smooth experience (I move note and the rest is taken care of including attachments in the background)
  2. be able to manually navigate to the folder on the desktop (Finder, Explorer) with files and attachments and be able to see my markdown file there along with the attachments there nicely together. That gives me peace to my paranoia of having my notes safe.

I am more of that hierarchical approach for knowledge/reference management persona.

But I could also live with the fluid note-focused approach for Zettelkasten-style knowledge development persona if:

  1. all of attachments are consistent (so the IMPORTER plugin should also provide the choice of importing the attachment into the database with the expectation I am the Zettelkasten persona)
  2. All attachments should have the option to be auto-renamed so that their name includes the note name. This will allow the attachments to be sorted and found when looking for them manually in Finder / Exporer on Desktop.

I came from Evernote and I split my notes between Joplin and Obsidian since I want to run 2 separate databases for privacy reasons on different sets of computers and devices.

For me Joplin experience so far has been great, except for the PDF loading slower on notes and the sync being slower when using my own Dropbox/OneDrive (and not Joplin server). Obsedian is faster and renders PDFs well, sync is fast, but this attachment management got me off the track a bit. Still trying to figure out how to set it up. Because, to me it seems, once a choice is made, it’s hard to change later on and the plugins may not solve the mess.

How how I was struggling, you can see here, I had to consult ChatGPT to get my head around all the plugins:

And yet there seem to be a few more plugins now I am looking at like Attachment Management and Custom Attachment Location :exploding_head:

1 Like

Okay I have finally sorted things out with my Evernote import and the attachment chaos.

Here is my summary of notes and recommended addons for users coming from Evernote: