README file from
Githubobsidian-attachment-uploader
This Obsidian plugin helps you upload local attachments to cloud storage. You can customize the upload shell command and specify which attachment formats to upload.
Features
- Custom shell command for uploading
- Customizable attachment formats to upload
- Option to delete original attachments after upload
- Automatic upload when pasting or dragging from outside Obsidian
Installation
- In Obsidian, open the plugin manager
- Search for "obsidian-attachment-uploader"
- Click "Install", then enable and configure after installation
Configuration
- Install an image hosting tool (with shell upload command) or create a custom shell upload command
- Configure the Obsidian attachment uploader plugin:
- Upload Command: Configure the shell command for uploading attachments
- Attachment Formats to Upload: Configure which attachment formats to upload (separated by line breaks)
- Delete Original After Upload: Configure whether to delete original attachments after upload
- Custom command examples:
- uPic shell execution command:
/Applications/uPic.app/Contents/MacOS/uPic -o url -u /local.png - Shell output format:
Uploading ... Uploading 1/1 Output URL: https://r-w.oss-cn-shanghai.aliyuncs.com/uPic/Snipaste_2024-08-18_22-14-14.png?x-oss-process=image/auto-orient,1/quality,q_80/format,webp - This plugin uses
%sto replace the local image path and extracts the image URL from shell output usingurlMatch = stdout.match(/\s+(https?:\/\/\S+)/) - Therefore, the uPic command should be:
/Applications/uPic.app/Contents/MacOS/uPic -o url -u %s - If writing your own upload script, make sure to print the uploaded image's network URL in the shell output
- uPic shell execution command:
Usage
- Open a note containing attachments in Obsidian
- Press
command+pto open the command palette and typeUpload editor attachments, or use the Ribbon button
Credits
- Inspired by typora image upload functionality