Attachment Management

by trganda
5
4
3
2
1
Score: 63/100

Description

The Attachment Management plugin provides advanced tools for organizing and renaming attachment files in Obsidian. It enables users to define flexible paths and naming conventions for attachments using variables like note name, note path, date, and MD5 hashes. The plugin supports automatic renaming of attachments when they are added, pasted, or dropped into markdown or canvas files, as well as when associated notes are renamed. Features include handling duplicate files, overriding settings for specific folders, files, or extensions, and excluding specified paths from processing. Experimental tools allow rearranging linked attachments to match configured settings.

Reviews

  • Qsmiron Qsmir
    Reviewed on Jun 2nd, 2026
    No review text provided.

Stats

300
stars
68,587
downloads
26
forks
1,095
days
26
days
26
days
76
total PRs
6
open PRs
8
closed PRs
62
merged PRs
128
total issues
80
open issues
48
closed issues
73
commits

Latest Version

a month ago

Changelog

📦 Uncategorized

  • feat: restore mixed ${originalname} usage and storage persistence
    • PR: #216
  • perf: debounce rename Notice to avoid UI flooding
    • PR: #215

README file from

Github

Obsidian Attachment Management

This plugin supports more flexibly setting your attachment location with variables like ${notepath}, ${notename}, ${date} and ${md5}. An override setting feature can be used to change the global setting of a folder, file or extension.

Read the Original Name section before using the ${originalname} variable. Read the FAQ section if you have any questions about how to use this plugin.

Installation

  • Install from Obsidian community plugins.
  • Clone this repo
    • pnpm i to install dependencies
    • pnpm run build to start compilation in watch mode.
    • Copy the main.js, manifest.json and style.css files to your vault VaultFolder.obsidian/plugins/obsidian-attachment-management
  • Download the release file and unarchive the file to your vault VaultFolder.obsidian/plugins/obsidian-attachment-management

Usage

Install and enable the plugin, after configuration you can paste or drop attachment file as usually and it will be auto renamed.

This plugin supports a command Rearrange linked attachments/Rearrange all linked attachments. If you run this command, it will rename all attachments (image file default, to rename another type, you need to enable Handle All Attachements) that have been linked in the markdown or canvas file as you configured.

SCR-20230511-rrtk

Notice: The Rearrange linked attachments/Rearrange all linked attachments is currently an experimental feature; if you want to try it out, it's best to back up your files first.

Overriding Setting

You can set the attachment path setting for a file or folder. The priority of these settings are:

file setting > most close parent folder setting > global setting

If you want to reset the settings of files or folders to the global setting, use the command Reset Override Setting or the Reset button on the override setting panel. The reset will only work on each file or folder that you trigger the command on. A more appropriate method to handle resetting will be added in the future.

Original Name

The ${originalname} variable represents the filename (without extension) of the attachment at the moment it was first added to the vault. You can use it on its own (e.g. ${originalname}) or combine it with other text and variables (e.g. IMG-${originalname}-${date}).

The plugin persists the original name in data.json under originalNameStorage, keyed by the file's MD5 hash. This means that even after the attachment has been renamed by the plugin or by a subsequent Rearrange linked attachments run, ${originalname} will still resolve to the truly-original basename.

Note on duplicate content: the storage is keyed by MD5, so two attachments with identical bytes share a single record. If you paste/drop two distinct files that happen to have the same content, only one original name will be retained for that md5; both files will resolve ${originalname} to that same value.

Use the command Clear unused original name storage to prune entries whose file is no longer linked in the vault.

Roadmap of Features

This plugin currently supports:

  • Setting the attachment location with ${notepath}, ${notename}, ${date} and ${parent}
  • Auto-rename the attachment when pasting to markdown or canvas
  • Auto-rename the attachment file or folder while you rename the article (markdown or canvas) file
  • Auto-rename the attachment when dropping to markdown or canvas
  • Re-Arrange the attachment file that is linked by markdown or canvas to the corresponding path as you configured (experimental)
  • Processing duplicate attachment
    • Processing duplicate attachment on create (the first time, you paste or drop an attachment in notes)
    • Processing duplicate attachment on rename
  • Override attachment configuration for specified notes or folder
  • Exclude folders that you want this plugin to skip
    • Add Exclude folder by menu

Settings

The path of attachment is composed of three parts :

{root path}/{attachment path}/{attachment name}.extension

And you can use the variables below to config:

  • ${notepath}: The directory of the markdown or canvas file under the vault root.
  • ${notename}: The filename of the markdown or canvas file (without file extension).
  • ${parent}: The parent folder name of the markdown or canvas file.
  • ${originalname}: The filename of the attachment file when it was first created in Obsidian.
  • ${date}: Date time format by Moment format options

Notice before using ${originalname}: see the Original Name section for how the original filename is persisted and how duplicate-content files are handled.

Root Path to Save New Attachments

You must select a root folder to save the attachment associated with a markdown or canvas file.

SCR-20230511-rgge

It can be set using the config of Obsidian in Files & Links and reset using this option.

  • Copy Obsidian settings: use the Obsidian setting in the Files & Links section.
  • In the folder specified below: set a fixed folder.
  • Next to note in folder specified below: in the subfolder of the current markdown or canvas file.

Attachment Path

A sub-folder to place attachment under the {root path}, available variables:

  • ${notepath}: The directory of the markdown or canvas file under the vault root.
  • ${notename}: The filename of the markdown or canvas file (without file extension).
  • ${parent}: The parent folder name of the markdown or canvas file.

Default value ${notepath}/${notename}.

Attachment Format

Set how to rename the attachment and available variables:

  • ${notename}: The filename of the markdown or canvas file (without file extension).
  • ${originalname}: The filename of the attachment file when first time it created.
  • ${date}: Date time format by Moment format options
  • ${md5}: MD5 hash of the attachment file (calculated when the attachment file was first created in the vault).

default value IMG-{date}.

Date Format

Use Moment format options to set the ${date}, default value YYYYMMDDHHmmssSSS. You should always use the ${date} variable to prevent the same file name.

Exclude Extension Pattern

This option is useful if you want to ignore some file types. Write a Regex pattern to exclude certain extensions from being handled.

SCR-20230918-pkys

Automatically Rename Attachment

Automatically rename the attachment folder/filename when you rename the folder/filename where the corresponding md/canvas file is placed.

Extension Override Setting

This feature allows you to specify the setting for a serials extension. You can use a regex pattern here to override the global setting.

SCR-20230918-pihr

Exclude Paths

If you want some paths to be skipped by this plugin, add them to the text area. If you have multiple paths, split them with a semicolon ';'.

By default, the "Exclude paths" will only work on the folder you added, and that folder contains at least one markdown file; you can toggle "Exclude subpaths" to exclude subpaths also.

The path is case-sensitive and should not have a leading slash '/' at the beginning.

Known Issues

  • No support for processing duplicated file names right now (in development). In backup, you could use the data variable x to use Unix timestamp with millisecond as filename (it will prevent duplicated filename).
  • When pasting or dropping a file in canvas and markdown, it will delay showing the updated link/filename. The reason is that Obsidian's API has no paste or drop event support for canvas, so I have implemented it in another way, and this caused the delay in renaming the attachment.

Screen Recording

  • Suppose you have a structure below with default configuration:
    • Attachment directory, "assets/notes/hello/1.png"
    • Note directory, "notes/Hello.md"
    • Running the Rearrange command may lead to an error since the folder already exists but has a lowercase name.

FAQ

Q1: What if I add '/' to Exclude Paths?

A1: It will exclude the whole vault folder.

Q2: Is this plugin support auto rename pdf file?

A2: By default, this plugin will only rename the image file. For other file types, you can use the extension override setting.

Q3: The link of the attachment in markdown file is not updated after I directly rename the attachment file, why?

A3: Make sure you have enabled the "Automatically Rename Attachment" option in the plugin setting, and "Files and links -> Automatically update internal links" in Obsidian setting.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Alias Management
2 years ago by WithMarcel
Identify duplicate notes based on similar aliases and filenames in Obsidian.
Attachment Manager
3 years ago by chenfeicqq
Attachment folder name binding note name, automatically rename, automatically delete, show/hide.
Attachment Uploader
3 years ago by zhuxining
An attachment uploader plugin for Obsidian
Attachments Cache
a year ago by luisbs
Obsidian plugin to cache attachments locally
Auto Folder Note Paste
a year ago by d7sd6u
Convert your note into folder note upon pasting or drag'n'dropping an attachment
Bulk Rename
4 years ago by Oleg Lustenko
Clone Vault
a year ago by Sebastian Baroni
Clones the current Obsidian vault by copying settings and folder structure without note contents.
Cloud Storage
2 years ago by Jiajun Ma
Obsidian Cloud Storage is a powerful and user-friendly plugin designed to seamlessly integrate cloud storage capabilities into your Obsidian workflow. This plugin allows you to effortlessly upload your attachments to the cloud, freeing up local storage space and enabling easy sharing and access across all your devices.
Consistent attachments and links
5 years ago by Dmitry Savosh
Obsidian plugin. Move note with attachments.
Custom Attachment Location
5 years ago by RainCat1998
Customize attachment location with variables($filename, $data, etc) like typora.
Custom File Explorer sorting
4 years ago by SebastianMC
Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
Daily Named Folder
5 years ago by Nemo Andrea
Like daily note, but nested in a daily folder and some more improvements
Daily Notes Automater
a year ago by David Pedrero
ExMemo Tools
2 years ago by Yan.Xie
Use large models for smart document management and optimization, including relocating files, enhancing text, and generating metadata.
File Cleaner
4 years ago by Johnson0907
A file cleaner plugin for Obsidian.
File Cleaner Redux
3 years ago by husjon
A plugin for Obsidian to help clean up files in your vault
Folder by tags distributor
2 years ago by RevoTale
Automatically group Obsidian notes into folder by tags specified in note.
Folder Index
4 years ago by turulix
FolderFile Splitter
a year ago by Xu Quan
Google Keep Import
3 years ago by Dale de Silva
Imports Google Keep backup files
Image Size
a year ago by Jie Zhang
Set the default size for pasted images.
Infostacker Note Publish
2 years ago by Taskscape LTD, Patryk Nowak, Kacper Pabianiak
Infostacker plugin for Obisidian
Insert Multiple Attachments
a year ago by mnaoumov
Obsidian Plugin that allows to insert multiple attachments at a time
Janitor
4 years ago by Gabriele Cannata
Performs various maintenance tasks on the Obsidian vault
Linked Note Exporter
10 months ago by the-c0d3r
Obsidian plugin to export a note along with all its attachments and linked notes—cleanly, conveniently, and ready to share.
Local Any Files
a year ago by ShermanTsang
A obsidian plugin used to extract and download files in your obsidian note.
Note Companion Folder
2 years ago by Chris Verbree
A Obsidian Plugin providing a way to associate a folder to a note
Note Folder Autorename
5 years ago by PJ Eby
Obsidian plugin to support folder-overview notes by keeping their folder in sync
Nuke Orphans
4 years ago by Sandorex
Obsidian notes plugin that trashes orphaned files and attachments
Obsidian markdown export
4 years ago by bingryan
This plugin allows to export directory/single markdown to a folder. support output format(html/markdown/text)
Paste Image Into Property
a year ago by Nito
Paste image rename
4 years ago by Reorx
Renames pasted images and all the other attachments added to the vault
Project Browser
2 years ago by Dale de Silva
S3 attachments storage
3 years ago by TechTheAwesome
An Obsidian plugin for storage and retrieval of media attachments on S3 compatible services.
Sync-safe file names
8 months ago by j-maas
Ensure your Obsidian files can always be synced across all your devices.
Unique attachments
5 years ago by Dmitry Savosh
Obsidian plugin. Renames attachments, making their names unique.