Tag: 回形针动作管理器

无法通过Paperclip将存储在S3上的文件添加为ActionMailer中的附件

我正在使用Paperclip和S3在Rails 3应用程序中上传和存储文件。 上传文件效果很好,但在尝试使用actionmailer将上传的文件附加到电子邮件时,我遇到了问题。 经过大量的故障排除后,希望有人可以提供一些提示。 从高层次来看,似乎我可能需要首先下载文件,在附加之前使用某种下载方法,这是建议在这里但我不完全遵循如何实现 – paperclip + ActionMailer – 添加附件? 在应用程序中,在用户上传文件(在本例中为测验)后,管理员应通过电子邮件通知用户上传的文件。 我一直在遇到“没有这样的文件或目录”。 以下是我正在使用的代码。 任何想法或建议将不胜感激! Quiz.rb model – what users are uploading: class Quiz 50.kilobytes validates_attachment_presence :quiz_path validates_attachment_content_type :quiz_path, :content_type => [“application/pdf”,”application/vnd.ms-excel”, “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”], :message => ‘We only accept Microsoft Excel files ending in .xlsx or .xls’ belongs_to :user belongs_to :tutorial has_attached_file :quiz_path, :storage => :s3, […]