Module: CarrierWave::Uploader::ExtensionWhitelist

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject

Override this method in your uploader to provide a white list of extensions which are allowed to be uploaded. Compares the file’s extension case insensitive. Furthermore, not only strings but Regexp are allowed as well.

When using a Regexp in the white list, ‘A` and `z` are automatically added to the Regexp expression, also case insensitive.

Returns

NilClass, Array

a white list of extensions which are allowed to be uploaded

Examples

def extension_white_list
  %w(jpg jpeg gif png)
end

Basically the same, but using a Regexp:

def extension_white_list
  [/jpe?g/, 'gif', 'png']
end


36
# File 'lib/carrierwave/uploader/extension_whitelist.rb', line 36

def extension_white_list; end