Zip up all Paperclip attachments stored on S3

前端 未结 2 1416
别那么骄傲
别那么骄傲 2021-02-07 11:39

Paperclip is a great upload plugin for Rails. Storing uploads on the local filesystem or Amazon S3 seems to work well. I\'d just assume store files on the localhost, but the use

2条回答
  •  既然无缘
    2021-02-07 11:52

    You almost certainly want to use e.abstract.to_file.path instead of e.abstract.url(...).

    See:

    • Paperclip::Storage::S3::to_file (should return a TempFile)
    • TempFile::path

    UPDATE

    From the changelog:

    New in 3.0.1:

    • API CHANGE: #to_file has been removed. Use the #copy_to_local_file method instead.

提交回复
热议问题