by AAM Plugin on WordPress.org
Add-on to the free Advanced Access Manager plugin that protects media files from direct access for visitors, roles or users

Restrict access to media file with AAM UI
Prevent direct access to the unlimited number of media library items either for visitors, individual users or groups of users (roles). This plugin does not modify a physical file’s location or URL.
The AAM Protected Media Files plugins is the official add-on to the free Advanced Access Manager (aka AAM). While this plugin actually manages physical access to the media files, AAM provides the UI interface to define access to files.
/wp-content/uploads folder. For more information, please check our installation instructions;.svg, .sketch, etc.). For the list of all allowed extensions, check official WP documentation for the wp_get_ext_types() core function;For more information about how properly install and use it, refer to our documentation.