Skip to content

v0.1.3 — Fix 400 on upload + simpler settings

Choose a tag to compare

@atbeta atbeta released this 25 Jul 02:55
689c25d

Fixes

1. 400 'fail to parse multipart form' (the actual blocker)

requestUrl({ body }) only accepts string | ArrayBuffer. The previous build cast a FormData instance to ArrayBuffer, which compiled fine but sent garbage to the server (no Content-Type: multipart/form-data; boundary=... header → server couldn't parse the body).

Replaced with a hand-rolled multipart body builder: pick a boundary, encode Content-Disposition + Content-Type + filename as a header, append the raw image bytes, append the closing boundary, send as a single ArrayBuffer with the right Content-Type header. Same pattern as babarot/obsidian-image-uploader-to-api.

2. Endpoint: /api/v1/upload/api/v1/flat/upload

The flat handler is built for external upload tools (PicGo, uPic, Dropshare) and returns a simpler JSON shape {url, markdown, html, bbcode, thumbnail_url} (no links wrapper). Both accept multipart, but flat is cleaner here.

3. Settings UI

  • Removed the Insert format dropdown — Obsidian is markdown-native, no one needs HTML / BBCode insertion.
  • Removed the standalone 'Auto-discover picfast CLI config' info block. The auto-discovery hint is now folded into the Base URL and API token descriptions inline where users actually look.

Install

Same path, new files: download main.js, manifest.json, styles.css from this release and overwrite the v0.1.2 files in .obsidian/plugins/picfast-image-uploader/. No settings migration needed (defaultFormat field is gone, so an existing defaultFormat key in your settings.json is silently ignored).