diff --git a/app/uploaders/cerfa_uploader.rb b/app/uploaders/cerfa_uploader.rb index 8040d94ff..8b966aa4a 100644 --- a/app/uploaders/cerfa_uploader.rb +++ b/app/uploaders/cerfa_uploader.rb @@ -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 diff --git a/app/uploaders/piece_justificative_uploader.rb b/app/uploaders/piece_justificative_uploader.rb index 3fbc4b32f..5337f87c3 100644 --- a/app/uploaders/piece_justificative_uploader.rb +++ b/app/uploaders/piece_justificative_uploader.rb @@ -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