fix: slice File to Blob before append so 3rd-arg filename is always used

This commit is contained in:
2026-06-19 15:33:13 +02:00
parent 597add6c1d
commit fbc4fc195b
@@ -138,8 +138,9 @@ function initUpload(formEl) {
status.className = 'gpx-status';
btn.disabled = true;
const slugged = slugifyFilename(file.name);
const fd = new FormData();
fd.append('file', file, slugifyFilename(file.name));
fd.append('file', file.slice(0, file.size, file.type), slugged);
const res = await apiFetch(`${API}/pages${route}/media`, { method: 'POST', body: fd });
btn.disabled = false;