* Fix #1642, fix #1912 - Previous change (#1718) did not modify how original file was saved on upload * Fix for when file is missing
This commit is contained in:
parent
6bd1019235
commit
e09ab2c0bd
3 changed files with 29 additions and 5 deletions
|
@ -4,7 +4,7 @@ Paperclip.options[:read_timeout] = 60
|
|||
|
||||
Paperclip.interpolates :filename do |attachment, style|
|
||||
return attachment.original_filename if style == :original
|
||||
[basename(attachment, style), content_type_extension(attachment, style)].delete_if(&:empty?).join('.')
|
||||
[basename(attachment, style), extension(attachment, style)].delete_if(&:empty?).join('.')
|
||||
end
|
||||
|
||||
if ENV['S3_ENABLED'] == 'true'
|
||||
|
@ -39,6 +39,6 @@ if ENV['S3_ENABLED'] == 'true'
|
|||
Paperclip::Attachment.default_options[:s3_host_alias] = ENV['S3_CLOUDFRONT_HOST']
|
||||
end
|
||||
else
|
||||
Paperclip::Attachment.default_options[:path] = (ENV['PAPERCLIP_ROOT_PATH'] || ':rails_root/public/system') + '/:class/:attachment/:id_partition/:style/:filename'
|
||||
Paperclip::Attachment.default_options[:url] = (ENV['PAPERCLIP_ROOT_URL'] || '/system') + '/:class/:attachment/:id_partition/:style/:filename'
|
||||
Paperclip::Attachment.default_options[:path] = (ENV['PAPERCLIP_ROOT_PATH'] || ':rails_root/public/system') + '/:class/:attachment/:id_partition/:style/:filename'
|
||||
Paperclip::Attachment.default_options[:url] = (ENV['PAPERCLIP_ROOT_URL'] || '/system') + '/:class/:attachment/:id_partition/:style/:filename'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue