一个上传器和两个不同的文件类型(pdf和xml)与Carrierwave

时间:2022-05-24 12:17:18

Is it possible to use one Uploader for two different file types with CarrierWave?

是否可以使用一个上传器与CarrierWave两种不同的文件类型?

I've seen Carrierwave has versioning for images, but the file types I'm interested are PDF and XML. I need to upload a PDF version of my object, as well as a XML version to Amazon S3.

我见过Carrierwave有图像版本,但我感兴趣的文件类型是PDF和XML。我需要将我的对象的PDF版本以及XML版本上传到Amazon S3。

Thanks,

1 个解决方案

#1


0  

exactly like you have write in carrierwave documentation

就像你在carrierwave文档中写的那样

class MyUploader < CarrierWave::Uploader::Base
  def extension_white_list
    %w(pdf xml)
  end
end

#1


0  

exactly like you have write in carrierwave documentation

就像你在carrierwave文档中写的那样

class MyUploader < CarrierWave::Uploader::Base
  def extension_white_list
    %w(pdf xml)
  end
end