Skip to main content
Documentation/Developers/APIs/Forms/Registering Additional Form File Types

Registering Additional Form File Types

Breakdance’s File Upload field gets its Allowed File Types choices from WordPress. Register an extension and MIME type in WordPress to make it available to the form.

Register an Extension

Add an upload_mimes filter in a custom plugin or a PHP snippets plugin configured to run on both admin and front-end requests. This example permits Markdown files as plain text:

PHP
add_filter('upload_mimes', function ($mimes) {
    $mimes['md'] = 'text/plain';
    return $mimes;
});

The array keys are file extensions without a leading dot; values are MIME types. Add entries to the existing array rather than replacing it. The registration affects WordPress uploads site-wide, including the Media Library. See the WordPress upload_mimes reference.

A file-type management plugin that registers WordPress MIME types can provide the same registration without a custom snippet.

Allow the Type in a Form

  1. Reload the Breakdance editor after activating the registration.
  2. Select Form Builder. From the Content tab, open Form > Fields and select the File Upload field.
  3. Select the extension in Allowed File Types and click Save.
Form Builder Content tab with a File Upload field showing the registered md option in Allowed File Types
Form Builder Content tab with a File Upload field showing the registered md option in Allowed File Types

An empty selection uses WordPress’s allowed types; it does not allow every possible file. Breakdance stores these choices by MIME type, so extensions sharing a MIME type can be allowed together.

Submit a real file of the new type through the saved form. Registering an extension does not bypass WordPress’s file-content checks or the form’s size and count limits. See File Uploads for storage and attachment settings.