# 06-Jul-2026 — Pasting an image into content saves reliably again

## [build 747](https://github.com/nbarrett/ngx-ramblers/actions/runs/28758523783) — [commit 0bc3987](https://github.com/nbarrett/ngx-ramblers/commit/0bc39872e750629fd6cfa13d6ee4a03694f9d0ad)

_____

Pasting an image into the cropper and saving produced a 500 that
returned an HTML error page, which the upload response handler then
tried to JSON.parse ("Unexpected token '<'"), crashing the editor.

Root cause: a pasted image arrives as a base64 data URL that becomes
the column imageSource / preloadImage. The cropper built the upload
File with its name set to that entire data URL, so the multipart part
header was ~870KB and multer/busboy rejected it, yielding Express's
default 500 HTML page.

- file-utils: applyBase64ToFile now routes the requested name through
a new safeUploadFileName, which falls back to a generated
pasted-content filename when the name is a data URL or over 255
chars. Covers both croppedFile paths (imageCropped and the
non-croppable auto-generate), so any paste gets a real filename.
- file-upload.service: validateAndParse no longer throws on a
non-JSON response; it shows a clear upload error instead of an
uncaught SyntaxError.
- aws-routes: the file-upload route wraps multer so a parse/limit
error returns a JSON 400 instead of a 500 HTML page.