Skip to content

Media Utils: Allow limiting uploads to a single file #68629

Closed
@Mamaduka

Description

@Mamaduka

A proposal to update the uploadMedia method and allow limiting uploads to a single file. When filesList exceeds the set limit, the function will call an onError callback and exit early.

Why?

The mediaUpload setting, which utilizes this method, is often used with the DropZone component. This component allows any number of files, but consumers only see and use the first file.

Currently, restrictions need to be set on the consumer level. Examples:

Proposal

Introduce a new boolean multiple boolean argument for uploadMedia and mediaUpload methods. The multiple also matches the prop used by the MediaUpload component.

cc @swissspidy, @t-hamano

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions