bozhang66 downloadsUpload local images in Markdown to cloud storage (COS, OSS, Qiniu, SM.MS, GitHub) and replace links automatically.
Upload local images in your Markdown documents to cloud storage and automatically replace the links.
English | 中文
 and Obsidian ![[path]] syntaxmain.js, manifest.json, and styles.css from the latest releaseimage-to-cos in your vault's .obsidian/plugins/ directoryExample for Tencent Cloud COS:
my-bucket-1250000000)ap-guangzhou)Ctrl/Cmd + P to open the command paletteThe plugin recognizes the following local image formats:
 # Standard Markdown
![[images/photo.png]] # Obsidian Wiki link
![[images/photo.png|My Photo]] # Wiki link with alias
The plugin recognizes the following local video embeds:
 # Standard Markdown embed
![[videos/demo.mp4]] # Obsidian Wiki embed
![[videos/demo.mp4|Demo]] # Wiki embed with alias
The plugin also detects media inside HTML tags and uploads the local files:
<img src="images/photo.png" alt="Photo">
<video controls>
<source src="videos/demo.mp4" type="video/mp4">
</video>
<video src="videos/direct.webm" controls></video>
Only the src attribute is replaced with the remote URL; the rest of the tag is preserved.
After upload, links are replaced with remote URLs. Obsidian renders  as a video player.
Open Settings → Image to COS to configure the plugin.
Choose your preferred cloud storage provider:
Configure how uploaded images are organized in cloud storage:
| Template | Pattern | Example |
|---|---|---|
| By date | {year}/{month}/{day}/{filename}-{hash}.{ext} |
2026/02/02/screenshot-a1b2c3d4.png |
| By document | notes/{note}/{filename}-{hash}.{ext} |
notes/My Note/screenshot-a1b2c3d4.png |
| By document path | {note-path}/{filename}.{ext} |
diary/2026/02/My Note/screenshot.png |
| Pure hash | images/{hash-full}.{ext} |
images/a1b2c3d4e5f6...png |
| Timestamp | img/{timestamp}-{filename}.{ext} |
img/1738483200000-screenshot.png |
Available variables:
{year} - Current year (4 digits){month} - Current month (2 digits){day} - Current day (2 digits){timestamp} - Unix timestamp (milliseconds){filename} - Original filename (without extension){ext} - File extension (without dot){hash} - MD5 hash (first 8 characters){hash-full} - Full MD5 hash (32 characters){note} - Current document name (without extension){note-path} - Current document relative path{uuid} - Random UUID (8 characters)Note: Video files can be large. GitHub uploads are limited to 100 MB per file, and SM.MS is limited to 5 MB. Tencent Cloud COS, Alibaba Cloud OSS, and Qiniu are recommended for larger videos.
data.json# Install dependencies
npm install
# Build for development (watch mode)
npm run dev
# Build for production
npm run build
# Run linter
npm run lint
This plugin uses PicGo-Core for image uploading.