Class: LighthouseDocumentUploaderBase
Instance Method Summary
collapse
#validate_virus_free
#converted_exists?, #final_filename, #read_for_upload, #tiff?, #tiff_or_incorrect_extension?
#validate, #validate_pdf
#set_aws_config
Instance Method Details
#extension_allowlist ⇒ Object
30
31
32
|
# File 'app/uploaders/lighthouse_document_uploader_base.rb', line 30
def extension_allowlist
%w[pdf gif png tiff tif jpeg jpg bmp txt]
end
|
#max_file_size_non_pdf ⇒ Object
34
35
36
|
# File 'app/uploaders/lighthouse_document_uploader_base.rb', line 34
def max_file_size_non_pdf
50.megabytes
end
|
#size_range ⇒ Object
26
27
28
|
# File 'app/uploaders/lighthouse_document_uploader_base.rb', line 26
def size_range
(1.byte)...(150.megabytes)
end
|
#validate_file_size(file) ⇒ Object
Lighthouse will split PDF’s larger than 50mb before sending to VBA who has a limit of 50mb. so, PDF’s can be larger than other files
40
41
42
43
44
45
|
# File 'app/uploaders/lighthouse_document_uploader_base.rb', line 40
def validate_file_size(file)
if file.content_type != 'application/pdf' && file.size > max_file_size_non_pdf
raise CarrierWave::IntegrityError, I18n.t(:'errors.messages.max_size_error',
max_size: '50MB')
end
end
|