fantasy-ke76 downloadsUpload images to CloudFlare ImgBed's plugin, which supports drag and drop, paste and select file uploads.
An image upload plugin for Obsidian that uploads images to CloudFlare ImgBed. It supports local image uploads, remote image fetch-and-upload, and batch replacement of image links in the current note.
Note: In Obsidian, the English link above opens in your browser.
这是一个用于 Obsidian 的图片上传插件,可以将图片上传到 CloudFlare ImgBed 服务,支持本地图片上传、网络图片抓取上传,以及当前文档图片批量替换。
main.js、manifest.json 和 styles.css 文件.obsidian/plugins/cf-imageBed/ 目录下npm install 安装依赖npm run dev 开始开发模式编译npm run build 构建生产版本https://your.domain)telegram、cfr2、s3、discord 或 huggingface0 表示关闭分块上传custom 模式会先按占位符模板重命名,再以原文件名方式上传<img> 或纯图片 URL 时,会先抓取原图再上传到自己的图床API URL 对应域名会自动加入排除范围,无需手动重复填写以下设置支持占位符:
| 占位符 | 含义 | 示例结果 |
|---|---|---|
${noteFileName} |
当前笔记文件名,不带 .md 扩展名 |
项目周报 |
${noteFolderName} |
当前笔记所在文件夹名称 | Projects |
${noteFolderPath} |
当前笔记所在文件夹路径 | Notes/Projects |
${noteFilePath} |
当前笔记完整路径 | Notes/Projects/项目周报.md |
${originalAttachmentFileName} |
原始附件文件名,不带扩展名 | image |
${originalAttachmentFileExtension} |
原始附件扩展名,不带点号 | png |
${date} |
当前日期,默认格式为 YYYYMMDD |
20260327 |
${time} |
当前时间,默认格式为 HHmmss |
153045 |
${datetime} |
当前日期和时间,默认格式为 YYYYMMDD-HHmmss |
20260327-153045 |
${timestamp} |
当前毫秒级时间戳 | 1774596645123 |
${uuid} |
随机 UUID | 550e8400-e29b-41d4-a716-446655440000 |
${noteFileName}、${noteFolderName}、${originalAttachmentFileName} 这类字符串占位符支持简单格式,例如 ${noteFileName:{case:'lower'}}、${originalAttachmentFileName:{slugify:true}}${date}、${time}、${datetime} 支持 momentJsFormat,例如 ${date:{momentJsFormat:'YYYY-MM-DD'}}${noteFileName}-${datetime}-${originalAttachmentFileName}custom 命名模式的实际行为是:先按模板把文件重命名,再按“原文件名”方式上传${noteFileName}-${datetime}-${originalAttachmentFileName}${noteFolderName}/${date}backup/${noteFolderName}/${noteFileName}| 渠道类型 | 优点 | 限制 |
|---|---|---|
| Telegram Bot | 完全免费、无限容量 | 大于 20MB 文件需分片存储 |
| Cloudflare R2 | 无文件大小限制、企业级性能 | 超出 10G 免费额度后收费,需要绑定支付方式 |
| S3 兼容存储 | 选择多样、价格灵活 | 根据服务商定价 |
| Discord | 完全免费、简单易用 | 大于 10MB 文件需分片存储 |
| HuggingFace | 完全免费、支持大文件直传 | 需要 HuggingFace 账号 |
插件支持五种常用方式:
Ctrl+V(Windows/Linux)或 Cmd+V(Mac)<img>,或直接复制图片 URLupload-image-mobile "📷 拍照或相册选择" 本插件使用 CloudFlare ImgBed 的上传 API,支持以下参数:
/uploadPOSTupload 权限的 API Token(Bearer Token)multipart/form-data插件会根据所选渠道和文件大小自动决定是否走分块上传流程。
详细 API 文档请参考 CloudFlare ImgBed 官方文档.。
上传失败
图片无法显示
拖拽上传不工作
、、 在上传后尺寸参数被移除的问题![[image.png|300]]、![[image.png|说明|400x300]] 在上传后丢失参数的问题C:\Users\...\image.jpg)的本地读取上传兜底(桌面端)CF ImageBed for ObsidiangetLanguage()manifest.json 最低版本提升到 1.8.7,并清理不必要的 authorUrl / fundingUrl如果你觉得这个插件有用,请考虑支持开发:


欢迎贡献!请随时提交 Issue 和 Pull Request 来改进这个插件。
本项目采用 Apache 许可证。详情请查看 LICENSE 文件。