udarent201 downloadsUpload attachments to your own S3-compatible storage and keep a local cache, so images still render with no network.
English · 简体中文
Your attachments live in your own storage — and still open offline. Paste a file into a note: it goes to your S3-compatible storage (Cloudflare R2, AWS S3, MinIO, Backblaze B2, self-hosted), the note keeps a link, and the file stays in your vault as the local copy — what renders is that copy, with no network round trip.
Install · Releases · Report a problem · Requires Obsidian 1.13.0+
Contents · Quick start · Why this plugin · Features · Requirements · Installation · Settings · Commands · Good to know · Troubleshooting · Privacy & security · How it is verified · Upgrading · Feedback · License

Paste it in: it uploads, the link is rewritten, the file stays in your vault as the local copy. One command opens the attachment manager; switch the storage off and all three still render — from the copies in your vault.
A vault full of attachments already? Upload all attachments in the settings does it in one go.
Upload-only plugins break offline; localize-only plugins need one online pass first. This one does both: the file goes to your bucket, rendering reads the copy in your vault, the original stays with you.
| Upload-only | Localize-only | This plugin | |
|---|---|---|---|
| Offline | broken | after one online pass | works — renders the local copy |
| New device | links work online | download everything again | missing copies back-filled on demand |
| Vault size | small | grows with every file | small — copies are disposable |
| Who holds the original | a third party | you, on one device | you, in storage you control |
ListBucket on that bucket — before every upload the plugin records which files this vault uses, and a cloud
delete reads the other devices' records first. Without it the plugin refuses to upload rather than risk deleting
something another device still uses. (R2's Object Read & Write includes it; on MinIO add s3:ListBucket.)From Obsidian: Settings → Community plugins → Browse → search Attachment Cloud Cache → Install → Enable.
Manually: put main.js, manifest.json and styles.css from the
latest release into
<vault>/.obsidian/plugins/attachment-cloud-cache/ (the folder name must equal the plugin id, or it will not load).
In Settings → Attachment Cloud Cache (Chinese names are in the 中文版 below).
| Group | Setting | What it does |
|---|---|---|
| Storage connection | Endpoint · Bucket · Region | Where the storage is. The bucket name is case-sensitive; self-hosted services usually take us-east-1. |
| Access key ID · Secret access key | The secret goes into the OS keychain, never data.json; Import from a credentials file reads MinIO's JSON. |
|
| Compatibility mode | Addresses files as endpoint/bucket/key; keep it on for R2, MinIO and most self-hosted services. |
|
| Public link address (optional) | Empty uses the address built above; fill it in for a CDN or your own domain. | |
| Unify object names | Turns the objects already in your bucket into pure content hashes and points the notes at them. Optional — new uploads are already content-addressed; run it once if your bucket still holds names from an older version. Running it again is safe. Needs the CopyObject permission. |
|
| Test connection | A light (checking / public / private / unreachable) + a button: re-checks upload, read-back, delete and outside reach. | |
| Upload | Upload new attachments automatically | On by default; off leaves new files local only. |
| Upload files from other sites | Off by default. The site list only narrows the automatic path; picking by hand is never restricted. | |
| Also upload files on this computer | Off by default, desktop only: “Upload all” then reads the file:/// paths in your notes. |
|
| Upload all attachments | Sends the files your notes reference to your storage and rewrites the links. | |
| Revert links to local paths | For when you stop using the plugin: links point at the files in your vault again; files with no local copy keep pointing at your storage. | |
| Offline and local copies | What happens to the local copy | Keep it (default, works offline) or delete it (saves space, no offline, and PDFs cannot be shown). |
| Download missing local copies automatically | Fetches files this device lacks; skipped in delete mode, except for a private bucket. | |
| Local copy limit (MB) · Space used | 0 means no limit; over the limit the least recently used go first, and only once the object is confirmed in your storage. |
|
| Logs and troubleshooting | Deletion log · Debug logging | Every permanent delete is written down; debug logging prints to the console and changes nothing. |
| Command | What it does |
|---|---|
| Attachment manager | The only command. One dialog (wide window on desktop, full screen on phones): a table of every attachment + counted filters (to clean up / not uploaded / uploaded / in cloud only / not referenced) + batch actions on the selection. It closes itself when the batch finishes, and one notice reports how many succeeded, were skipped, failed. |
Uploading the whole vault is not a command — it is Upload all attachments in the settings.
Upgrading from 1.8 or earlier? The old Upload attachments and Clean up attachments are gone — they are filters and batch actions in Attachment manager now; hotkeys need rebinding.
tiff, heic and ico are inserted as plain links — the host cannot preview them in an embed..cache-index.json first — it records where this device
keeps its copies. The secret key is not in the folder.Start with Settings → Attachment Cloud Cache → Test connection: the light answers “can this vault reach the storage, and can other people open my links”, and changes nothing.
| What you see | What it means | What to do |
|---|---|---|
Images blank, 403 in the console |
The bucket is private, the note holds a direct link | Nothing to fix — what renders is the local copy |
| Images blank, the light says Unreachable | Endpoint / bucket / keys | Re-run Test connection, then check the endpoint |
| The installer says No appropriate version found. | Obsidian older than 1.13.0 | Upgrade Obsidian — the installer is refusing, not a broken plugin |
| Links open for you, not for others | The bucket refuses anonymous reads | Accept it (links are for you), or make the bucket public / set a public link address |
| Broken on a second device | No local copy there, none could be downloaded | Open the note once to back-fill; if it stays broken, check the key can read |
| It says an off-site file is “a web page or plain text” and skips it | That address serves HTML | Refused on purpose — use a direct link |
| Test connection says the storage refused to write | The keys can read, not write | Uploads fail the same way — grant write access |
| Test connection says the address “answered with a web page” | A proxy or WAF returned 200 |
That is not public access — fix the public link address |
| A command seems to do nothing | Storage not set up (it says so), or a note cannot be read | Cleanup will not treat “unknown” as “unused” — fix that note and retry |
text/html and other text/* are refused.data.json; the access key ID is stored in the clear —
it is an identifier, not a secret. The file names you upload end up visible to your storage provider.Reproduce: npm run verify:real-storage (storage), node scripts/verify-connection-probe.mjs (connection).
 becomes
, for both in-vault links and local file:/// / off-site links. A label you wrote
yourself is never touched. Already-written empty links in old notes are left as they are.ListBucket; without it uploads are refused (see Requirements).<sha256>.<ext>, so the same file is one
object across every device, even when the names differ. Names still show as the original file name in your notes.
Objects you already have keep their old names and keep working — Unify object names converts them if you want
the bucket to look tidy.Upload files your notes link to…, Upload off-site or local files…, Pick files to cache…, Upload attachments, Clean up attachments — all gone: uploading and cleaning are filters and actions in
Attachment manager, and the whole vault goes up via Upload all attachments in the settings.Open an issue: https://github.com/udarent/obsidian-plugins-attachment-cloud-cache/issues — say what you saw, your Obsidian version and which storage you use. Issues and pull requests are welcome.
Working on it? npm install, then npm run dev (watch build) or npm test (build + all suites).
MIT — see LICENSE. Use it, modify it, redistribute it (commercial too); keep the copyright notice.
English · 简体中文
附件放在你自己的存储里,断网也照样能看。 粘一个文件进笔记:它传到你的 S3 兼容存储(Cloudflare R2、AWS S3、 MinIO、Backblaze B2、自建服务),笔记里留下链接,文件留在库里当本地副本 —— 显示就读它,不走网络。
安装 · 版本发布 · 反馈问题 · 需要 Obsidian 1.13.0+
目录 · 快速开始 · 为什么用它 · 功能 · 环境要求 · 安装 · 设置 · 命令 · 使用须知 · 常见问题 · 隐私与安全 · 验证情况 · 从旧版本升级 · 反馈 · 许可

粘贴即上传、链接即时改写,文件留在库里当本地副本。一条命令打开*附件管理;把存储整个停掉,三件照常显示 —— 读的是库里的副本。*
库里已有一堆附件?用设置页的 「上传全部附件」 一次搬完。
只上传的插件,一断网就裂图;只本地化的插件,得先联网跑一遍。这个插件两件一起做:文件进你的桶,显示读库里的 副本,原件在你自己手上。
| 只上传 | 只本地化 | 本插件 | |
|---|---|---|---|
| 断网时 | 打不开 | 联网跑过一次才行 | 能看 —— 读的是本地副本 |
| 换新设备 | 联网能看 | 全部重下一遍 | 缺的副本按需补回 |
| 库体积 | 小 | 每多一个文件就大一分 | 小 —— 副本随时可以删 |
| 原件在哪 | 第三方 | 你手里,但只在那台设备上 | 你自己控制的存储里 |
ListBucket 权限,没有就拒绝上传(而不是冒着删掉别人文件的风险)。ListBucket 权限 —— 每次上传前插件会记下本库引用了哪些文件,删除云端对象时先读其它设备的记录。
没有这个权限时插件拒绝上传(而不是冒着删掉别人还在用的文件的风险)。R2 的 Object Read & Write 已含它;
MinIO 需要显式加 s3:ListBucket。在 Obsidian 里装: 设置 → 第三方插件 → 浏览 → 搜 Attachment Cloud Cache → 安装并启用。
手动装: 从最新 release
下载 main.js、manifest.json、styles.css,放进 <库>/.obsidian/plugins/attachment-cloud-cache/
(目录名必须等于插件 id,否则不加载)。
在 设置 → Attachment Cloud Cache 里(各项的英文名见上面的英文版)。
| 分组 | 设置项 | 作用 |
|---|---|---|
| 存储连接 | 服务地址 · 存储桶 · 区域 | 存储地址。桶名区分大小写;自建服务一般填 us-east-1 之类。 |
| 访问密钥 ID · 秘密访问密钥 | 秘密密钥进系统钥匙串,不写 data.json;从凭据文件导入 可直接读 MinIO 的 JSON。 |
|
| 兼容模式 | 地址按 服务地址/桶/键 拼;R2、MinIO 和多数自建服务要开。 |
|
| 公开链接地址(可选) | 留空用上面拼出的地址;用 CDN 或自己域名时填。 | |
| 统一对象名 | 把桶里已有的对象改成纯内容哈希,并把笔记里的链接指过去。可选 —— 新上传的对象名本来就是纯哈希;桶里还留着旧版带名字的对象时跑一次即可,重复跑是安全的。需要 CopyObject 权限。 | |
| 测试连接 | 状态灯(检测中 / 公开 / 私有 / 无法访问)+ 按钮:重测上传、读回、删除、对外访问。 | |
| 上传 | 新附件自动上传 | 默认开;关掉后新文件只留本地。 |
| 站外文件也上传到云端 | 默认关。站点名单只约束自动这一路,手动挑不受限。 | |
| 同时上传本机文件 | 默认关,仅桌面。开启后「上传全部附件」会读笔记里的 file:/// 路径。 |
|
| 上传全部附件 | 把笔记引用到的附件传到你的存储并改写链接。 | |
| 把链接改回本地路径 | 想停用插件时用:把链接改回指向库里的文件;没有本地副本的仍指向存储。 | |
| 离线与本地副本 | 上传后如何处理本地副本 | 保留(默认,可离线)或不保留(省空间,不能离线,PDF 也看不了)。 |
| 自动下载缺失的本地副本 | 这台设备缺的文件自动取回;「不保留」时跳过,私有桶除外。 | |
| 本地副本上限(MB)· 占用空间 | 0 不限制;超限从最久没用的开始删,且先确认云端还有。 |
|
| 记录与排障 | 删除记录 · 排障日志 | 每次永久删除都记一笔;排障日志只打控制台,不改行为。 |
| 命令 | 作用 |
|---|---|
| 附件管理 | 唯一的命令。弹窗(桌面宽窗口 / 手机全屏):全库附件一张表 + 带件数的筛选(待清理 / 未上传 / 已上传 / 云端有本地无 / 没人引用)+ 勾选后批量处理。跑完自动关窗,一条通知报成、跳过、失败各几件。 |
整库一次传完不是命令 —— 它是设置页里的 「上传全部附件」。
从 1.8 及更早版本升级? 原来的「上传附件」「清理附件」已取消 —— 现在是「附件管理」里的筛选与批量动作, 快捷键需要重绑。
tiff、heic、ico 插入的是普通链接 —— 宿主不能在嵌入里预览。.cache-index.json —— 它记的是这台设备的副本位置。秘密密钥不在目录里。先看 设置 → Attachment Cloud Cache → 测试连接:灯回答「连不连得上存储、别人打不打得开链接」,且什么都不改。
| 现象 | 原因 | 怎么办 |
|---|---|---|
图一直空着,控制台报 403 |
桶是私有的,笔记里却是直链 | 不用修 —— 显示的就是本地副本 |
| 图空着,灯是「无法访问」 | 服务地址 / 桶名 / 密钥 | 重跑测试连接,再核对地址 |
| 安装时说 No appropriate version found. | Obsidian 低于 1.13.0 | 升级 Obsidian —— 安装机制在拒绝,不是插件坏了 |
| 链接自己打得开,别人打不开 | 桶拒绝匿名读 | 接受(只给自己用),或把桶改公开、配上公开链接地址 |
| 换台设备就打不开 | 那台没有本地副本,也补不下来 | 打开一次笔记让它补回;仍不行查密钥读权限 |
| 插件说站外文件是「网页或纯文本」,没上传 | 那个地址回的是 HTML | 刻意拒收 —— 换一条直链 |
| 测试连接 说存储拒绝写入 | 密钥能读不能写 | 上传会同样失败 —— 去加写权限 |
| 测试连接 说地址「回的是一个网页」 | 代理或 WAF 回了 200 |
这不是公开访问 —— 去改公开链接地址 |
| 点了命令像没反应 | 没配好存储(它会说),或有笔记读不到 | 清理不把「不知道」当「没人引用」 —— 处理好那篇再跑 |
text/html 等 text/* 一律拒收。data.json;密钥 ID 明文存着 —— 它是标识符,不是秘密。你上传时的文件名会出现在存储服务商那边。复现:npm run verify:real-storage(存储侧)、node scripts/verify-connection-probe.mjs(连接探测)。
[] 会补上真实文件名: → ,库内链接与
本机 file:////站外链接两条路都补。你自己写过的显示文字一个字不动;老笔记里已经写好的空链接不会回填。ListBucket;
没有这个权限时拒绝上传(见「环境要求」)。<sha256>.<ext>,于是同一个文件在所有设备上是同一个对象,
哪怕各自的名字不同。笔记里显示的仍是原来的文件名。桶里已有的对象保持旧名字、照常工作 ——
想让桶里整齐就点一次**「统一对象名」**。上传笔记引用的文件…、上传站外或本机文件…、挑选要缓存的外链…、上传附件、
清理附件 全部取消:上传与清理变成「附件管理」里的筛选与动作,整库一次传完用设置页的**「上传全部附件」**。到 https://github.com/udarent/obsidian-plugins-attachment-cloud-cache/issues 提 issue —— 说清你看到的、Obsidian 版本和用的哪家存储。欢迎 issue 与 PR。
改插件?npm install,然后 npm run dev(监听构建)或 npm test(构建 + 全部套件)。
MIT,见 LICENSE。 可自用、修改、再分发(含商用);保留版权声明。