Evgeny Pivovarov
Evgeny Pivovarov

Reputation: 13

Extension of downloadable file types in media. Drupal 8

Tell pls me if there is a way to expand the list of file types loaded via the media module:

For example: I would like to upload apk or zip files to this site via this module. Can you tell me what is already For example: I would like to upload apk or zip files to this site via this module. Can you tell me what is already made or will you have to suffer?

Upvotes: 1

Views: 1812

Answers (1)

Mark
Mark

Reputation: 121

Drupal 8 media allows you to specify the allowable files for each type of media.

For example, if you wanted the File media type to allow apk and zip uploads you can do so as follows:

  • Login to your site as an administrator.
  • Click Structure > Media types or visit https://yoursite.com/admin/structure/media
  • In the operations column click the dropdown next to the type of media you want to change (in this case File) and click Manage fields
  • Click Edit on the File field
  • In the Allowed file extensions section add apk, zip to the end of the list
  • Click save

Your existing File media should now support those existing two formats.

You can find out more about creating and configuring media content on the online documentation: https://www.drupal.org/docs/8/core/modules/media/creating-and-configuring-media-types

Upvotes: 1

Related Questions