Best way to change local file location for several or all images in a markdown file

Hi!

I have a lot of markdown files where I have images in different paths on my computer and I want to ingrate some in obsidian with their attachments in subfolder of current folder. Some use markdown tag, others have html tag with attributes.

Is there any tweak how I could achieve this efficiently?

I tried copying by my self and using replace, or just making screenshots, pasting again and deleting the old file.
These steps are working okay but feel kind of painful.

So if there might be an option or a plugin I am not aware of let me know, also if you have an idea some kind of script I could use I would be really happy!

Btw. I am on ubuntu.

Thanks in advance!

What I’m trying to do

I suggest migrate/copy all ur markdown files with attachment/pictures as is into Obsidian vault/folder. But make sure shortest link is selected in settings to make sure Obsidian detect those migrated markdown. Then u should install and enable this plugin to make sure the move the attachments within the same folder as the markdown.

Then u probably want to auto organise ur notes based on tags or metadata of the note. For that u can use this plugin

Hey thanks for taking your time!

I already tried a little bit with consistent attachments plugin but was not able to achieve it.
I set all the settings for it to work properly and when I run command “Check vault consistent” I get no errors for my files though they are using links like this

![](file:/home/felix/Documents/WS21-22-Repo/Grundlagen%20der%20Signalverarbeitung%20und%20des%20machinellen%20Lernens/assets/2022-02-08-14-29-45-image.png)

I see. I assumed the previous app u use for markdown uses relative path. Hence my suggestion to move the folder as is into ur Obsidian vault. But it seems that it uses filesystem absolute path. At this point, the plugin, i believe, treat that link as if a url or external link and will not change it.

I haven’t personally done this step after this happened, but i believe u can “convert” it to relative path again by doing search and replace text to remove file:/home/felix/Documents/WS21-22-Repo/ to ../, assuming “/WS21-22-Repo” is ur Obsidian vault. But u better use vscode for that due its better search and replace in bulk.

The idea is to make Obsidian detect it as object within the vault to make the consistent attachment plugin to work

1 Like

Okay I see,

doing it for the complete folder with vs code is a good approach thanks!

I just came up with another sufficient approach:

  1. Using a plugin which uploads all the pictures
  2. Using a plugin which downloads all images and stores them in a relative path and changes the link to relative path

I’ve seen that there are plugins which support these features, but haven’t had time to test for myself.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.