How to assign a remote file to Carrierwave?

后端 未结 4 1544
感情败类
感情败类 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:28

    I was looking for this as well.

    The blocking point in the zencoder case would be that Carrierwave doesn't track different different file type versions for the original file. It only references the original file.

    So having the original file as an .mp4 a a thumbnail version as a .png doesn't work. While you can have an 'image.png' and also track 'thumb_png_image.png', you can't also create a 'thumb_jpg_image.jpg' for the same file.

    Otherwise you could create a dummy version and using conditional versioning tell CW not to process it. Since CW would create the dummy version anyway but not upload it, you could have it reference a path matching the file returned by Zencoder. But oh well...

提交回复
热议问题