Use original file extension for uploaded files
This commit is contained in:
parent
2c7b65199e
commit
a62076c34b
2 changed files with 4 additions and 4 deletions
|
@ -31,9 +31,9 @@ class CerfaUploader < CarrierWave::Uploader::Base
|
|||
def filename
|
||||
if original_filename.present? || model.content_secure_token
|
||||
if Features.remote_storage
|
||||
filename = "#{model.class.to_s.underscore}-#{secure_token}.pdf"
|
||||
filename = "#{model.class.to_s.underscore}-#{secure_token}.#{file.extension.downcase}"
|
||||
else
|
||||
filename = "#{model.class.to_s.underscore}.pdf"
|
||||
filename = "#{model.class.to_s.underscore}.#{file.extension.downcase}"
|
||||
end
|
||||
end
|
||||
filename
|
||||
|
|
|
@ -31,9 +31,9 @@ class PieceJustificativeUploader < CarrierWave::Uploader::Base
|
|||
def filename
|
||||
if original_filename.present? || model.content_secure_token
|
||||
if Features.remote_storage
|
||||
filename = "#{model.class.to_s.underscore}-#{secure_token}.pdf"
|
||||
filename = "#{model.class.to_s.underscore}-#{secure_token}.#{file.extension.downcase}"
|
||||
else original_filename
|
||||
filename = "#{model.class.to_s.underscore}.pdf"
|
||||
filename = "#{model.class.to_s.underscore}.#{file.extension.downcase}"
|
||||
end
|
||||
end
|
||||
filename
|
||||
|
|
Loading…
Reference in a new issue