Lui*_* E. 5 ruby amazon-s3 ruby-on-rails-3 carrierwave
我有一个应用程序,它读取文件的内容并为其编制索引.我将它们存储在磁盘本身,但现在我正在使用Amazon S3,因此以下方法不再起作用.
它是这样的:
def perform(docId)
    @document = Document.find(docId)
    if @document.file?
      #You should't create a new version
      @document.versionless do |doc|
        @document.file_content = Cloudoc::Extractor.new.extract(@document.file.file)
        @document.save
      end
    end
  end
@document.file返回FileUploader,并doc.file.file返回CarrierWave::Storage::Fog::File该类.
我如何获得真实文件?
Zac*_*ker 11
调用@document.file.read将从Carrierwave中的S3获取文件的内容.
| 归档时间: | 
 | 
| 查看次数: | 5482 次 | 
| 最近记录: |