如何使用回形针复制文件

问题描述 投票:19回答:1

有人知道使用S3使用Paperclip复制文件的方法吗?在尝试编写自己的文章之前,我只是想确保没有办法做到这一点。谢谢

ruby-on-rails paperclip copying
1个回答
28
投票

[用回形针多弄乱后,我想通了。复制文件非常简单!

# Stupid example method that just copies a user's profile pic to another user.
def copy_profile_picture(user_1, user_2)
  user_2.picture = user_1.picture
  user_2.save # Copied the picture and we're done!
end

这在Amazon s3上也很好用。甜]]

© www.soinside.com 2019 - 2024. All rights reserved.