How to assign a remote file to Carrierwave?

后端 未结 4 1543
感情败类
感情败类 2020-12-08 01:19

I have video model with the following definition:

class Video
  require \'carrierwave/orm/activerecord\'
  mount_uploader :attachment, VideoUploader
  mount_         


        
4条回答
  •  悲哀的现实
    2020-12-08 01:27

    You can do the following:

    @video.remote_attachment_thumbnail_url = 'https://bucket_name.s3.amazonaws.com/uploads/users/1/video/1/thumb.png'
    

    But that will cause Carrierwave to download + reprocess the file rather than just make it the thumbnail. If you're not going to use Carrierwave's processing, then it might make more sense to just store the URL to the thumbnail on the model rather than even using Carrierwave.

提交回复
热议问题