0
在rails上创建一个UploadedFile对象我正在使用一个邮件服务器,它向我的应用发送JSON请求以通知收到的邮件。当处理附件,它给了我一个生:从参数
a1.name
# => e.g. 'sample.pdf'
a1.type
# => e.g. 'application/pdf'
a1.content
# => this is the raw content provided by Mandrill, and will be base64-encoded if not plain text
# e.g. 'JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvY ... (etc)'
a1.decoded_content
# => this is the content decoded by Mandrill::Rails, ready to be written as a File or whatever
# e.g. '%PDF-1.3\n%\xC4\xE5 ... (etc)'
我想要做的就是把它变成某种Rails的文件“对象,是适合用回形针过程。
任何想法如何最好地解决这个问题?
非常感谢, 克里斯。