Method: CarrierWave::SanitizedFile#size

Defined in:
lib/carrierwave/sanitized_file.rb

#sizeObject

Returns the file’s size.

Returns

Integer

the file’s size in bytes.



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/carrierwave/sanitized_file.rb', line 68

def size
  if is_path?
    exists? ? File.size(path) : 0
  elsif @file.respond_to?(:size)
    @file.size
  elsif path
    exists? ? File.size(path) : 0
  else
    0
  end
end