Diogo Peralta Cordeiro 6e031d623a [VersionBump] 2.0.0beta0 il y a 3 ans
..
locale 6e031d623a [VersionBump] 2.0.0beta0 il y a 3 ans
scripts 28a044077f [StoreRemoteMedia][SCRIPTS] Fix typo in query il y a 3 ans
README.md 422b82d3be [MEDIA] Allow thumbnail only entries il y a 3 ans
StoreRemoteMediaPlugin.php 761ce7fd81 [StoreRemoteMedia] Fix failing to show remote thumbnails on first load il y a 3 ans

README.md

The StoreRemoteMedia plugin downloads remotely attached files to local server.

IMPORTANT: If using both Embed and StoreRemoteMedia plugins, Embed should be added first.

Installation

add addPlugin('StoreRemoteMedia'); to the bottom of your config.php

Settings

  • domain_whitelist: Array of regular expressions. Always escape your dots and end your strings.
  • check_whitelist: Whether to check the domain_whitelist.

When check_whitelist is set, only images from URLs matching a regex in the domain_whitelist array are accepted for local storage.

  • thumbnail_width: Maximum width of the thumbnail in pixels. Defaults to global [thumbnail][width].
  • thumbnail_height: Maximum height of the thumbnail in pixels. Defaults to global [thumbnail][height].
  • crop: Crop to the size (not preserving aspect ratio). Defaults to global [thumbnail][crop].
  • max_size: Max media size. Anything bigger than this is rejected. Defaults to global [attachments][file_quota].
  • store_original: Whether to maintain a copy of the original media or only a thumbnail of it. Defaults to false.

Example

addPlugin('StoreRemoteMedia', [
    'domain_whitelist' => [
        '^i\d*\.ytimg\.com$' => 'YouTube',
        '^i\d*\.vimeocdn\.com$' => 'Vimeo'
    ],
    'check_whitelist' => true,
]);