Using a remote file as a snap in rails

I am trying to pull out a public AWS file and use it as an attachment, for example:

attachments['file.zip'] = open('https://s3.amazonaws.com/file.zip') 

I get No such file or directory

I changed the above paths to be generic, but I can really go to the AWS path and get the file. Is there any way to make it an application to use ActionMailer?

+4
source share
1 answer
 attachments['file.zip'] = open('https://s3.amazonaws.com/file.zip').read 

open returns an IO object, not the contents of the file. You must provide the contents of the attachments file.

+9
source

All Articles