diff --git a/themes/intotheeast/templates/gpx-manager.html.twig b/themes/intotheeast/templates/gpx-manager.html.twig index 9bf5135..cddba6c 100644 --- a/themes/intotheeast/templates/gpx-manager.html.twig +++ b/themes/intotheeast/templates/gpx-manager.html.twig @@ -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;