Module: CarrierWave::Uploader::ExtensionBlacklist

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/carrierwave/uploader/extension_blacklist.rb

Instance Method Summary collapse

Instance Method Details

#extension_denylistObject

NilClass, String, Regexp, Array[String, Regexp]

a deny list of extensions which are prohibited to be uploaded

Examples

def extension_denylist
  %w(swf tiff)
end

Basically the same, but using a Regexp:

def extension_denylist
  [/swf/, 'tiff']
end

34
35
36
37
38
39
40
# File 'lib/carrierwave/uploader/extension_blacklist.rb', line 34

def extension_denylist
  if respond_to?(:extension_blacklist)
    ActiveSupport::Deprecation.warn "#extension_blacklist is deprecated, use #extension_denylist instead." unless instance_variable_defined?(:@extension_blacklist_warned)
    @extension_blacklist_warned = true
    extension_blacklist
  end
end