{"id":6508,"date":"2026-10-30T01:07:00","date_gmt":"2026-10-30T04:07:00","guid":{"rendered":"https:\/\/tucumandevelopers.com\/index.php\/2026\/10\/30\/keep-the-filename-separate-when-appending-a-blob-to-formdata\/"},"modified":"2026-10-30T01:07:00","modified_gmt":"2026-10-30T04:07:00","slug":"keep-the-filename-separate-when-appending-a-blob-to-formdata","status":"publish","type":"post","link":"https:\/\/tucumandevelopers.com\/index.php\/2026\/10\/30\/keep-the-filename-separate-when-appending-a-blob-to-formdata\/","title":{"rendered":"Keep the filename separate when appending a Blob to FormData"},"content":{"rendered":"<div>\n<div><\/header>\n<div data-article-id=\"4944622\" id=\"article-body\">\n<p>Keep a Blob&#8217;s uploaded filename explicit in FormData. A plain Blob has no File name, so supply the name as append()&#8217;s third argument. The Blob contains data and a type, but has no File name.<\/p>\n<p>The third argument to append() supplies the name reported to the server. For example, form.append(&#8220;image&#8221;, blob, &#8220;preview.png&#8221;) names the uploaded part. The default name for a plain Blob is &#8220;blob&#8221;; a File uses its own filename unless another is supplied.<\/p>\n<p>Choose the extension from the output format you actually produced. Giving the part a .png name does not convert its bytes. When reading the server&#8217;s upload report, check the field name image and filename preview.png separately.<\/p>\n<p>Test with a small sample and inspect the name the server receives. Keep server-side validation in place; a supplied filename is descriptive metadata.<\/p>\n<p>Source: <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/FormData\/append\" target=\"_blank\" rel=\"noopener noreferrer\">MDN FormData.append()<\/a>.<\/p>\n<\/p><\/div>\n<\/article>\n<p> <!-- Bottom content skipped via SKIP_BOTTOM_CONTENT config --> <\/div>\n<p> <\/main> <\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Fuente: <a href=\"https:\/\/dev.to\/morphio\/keep-the-filename-separate-when-appending-a-blob-to-formdata-5hj7\">Art\u00edculo original<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Keep a Blob&#8217;s uploaded filename explicit in FormData. A plain Blob has no File name, so supply the name as append()&#8217;s third argument. The Blob contains data and a type, but has no File name. The third argument to append() supplies the name reported to the server. For example, form.append(&#8220;image&#8221;, blob, &#8220;preview.png&#8221;) names the uploaded [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6507,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"webixso_pending_account_ids":""},"categories":[41],"tags":[],"class_list":["post-6508","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devto"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/posts\/6508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/comments?post=6508"}],"version-history":[{"count":0,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/posts\/6508\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/media\/6507"}],"wp:attachment":[{"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/media?parent=6508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/categories?post=6508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tucumandevelopers.com\/index.php\/wp-json\/wp\/v2\/tags?post=6508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}