in Projects, Programming, Technology

Ruby: using send_file and send_data to relay files from one site through another

Cache and relay images using:

require 'uri'

class ImagesController < ApplicationController
  # relays remote images so that we can encrypt them
  def index
    data = open(params[:src])
    send_data, :type => data.content_type, :disposition => 'inline'

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.