As the result of a specific request of a client, I would get an XML file listing images, and I needed to download images using FTP and then add them to the application using paperclip.
Although Heroku does not let you permanently store files on its filesystem, you can use the filesystem to temporarily store files and then upload them somewhere else. In addition, you can actually use FTP on Heroku, as long as you use it in passive mode.
So, the process involved 2 steps
- Using FTP to download the files to a dyno
- Using paperclip to upload the downloaded files to S3
# FTPing from Heroku ftp = Net::FTP.new(server, user, pass) ftp.passive = true ftp.getbinaryfile(remote_filename, tmp_filename) # Uploading to S3 with paperclip my_object.attachment = File.open(filename) my_object.save!