Images outside the site

I’m developing a site that will need to display images that will be
stored in a location outside the site. What would be the easiest way to
do this? The site will be running on a linux machine.

Thanks,
Will


You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.

  • BD

Actually, the images in question need to be stored in the filesystem
outside the site, but I’d rather not expose them to the web. The flow of
operations I’d like to have is as follows:

  1. User requests an image, sending the image id. Under the hood, it hits
    a controller method, so the request would be something like
    (http://mysite.com/images/getbinary/152).
  2. My system picks up the id from the request and locates the image on
    disk
  3. Some component of rails grabs the image from disk and pushes down to
    the client.

For instance, in .NET I’d probably create an Image object, load it from
the image on disk, then serialize it into the response stream. That way,
the image would only be available to the user through the site.

Brian D. [email protected] wrote:

  • BD

On Jun 18, 7:27 am, Will G. wrote:

I’m developing a site that will need to display images that will be stored in a location outside the site. What would be the easiest way to do this? The site will be running on a linux machine.

Thanks,
Will


You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.


Get the Yahoo! toolbar and be alerted to new email wherever you’re
surfing.

That’s exactly what I needed. Thank you!

Rob B. [email protected] wrote: Look at send_file()

send_file( '/path/to/some/image_file.gif',
           :disposition => 'inline',
           :type => 'image/gif',
           :stream => false,
           :filename => 'private_file.gif' )

-Rob

On Jun 18, 2007, at 1:52 PM, Will G. wrote:

Actually, the images in question need to be stored in the filesystem
outside the site, but I’d rather not expose them to the web. The flow of
operations I’d like to have is as follows:

  1. User requests an image, sending the image id. Under the hood, it hits
    a controller method, so the request would be something like
    (http://mysite.com/images/getbinary/152).
  2. My system picks up the id from the request and locates the image on
    disk
  3. Some component of rails grabs the image from disk and pushes down to
    the client.

For instance, in .NET I’d probably create an Image object, load it from
the image on disk, then serialize it into the response stream. That way,
the image would only be available to the user through the site.

Brian D. [email protected] wrote:

  • BD

On Jun 18, 7:27 am, Will G. wrote:

I’m developing a site that will need to display images that will be stored in a location outside the site. What would be the easiest way to do this? The site will be running on a linux machine.

Thanks,
Will


You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.


Get the Yahoo! toolbar and be alerted to new email wherever you’re
surfing.


Choose the right car based on your needs. Check out Yahoo! Autos new
Car Finder tool.

Look at send_file()

 send_file( '/path/to/some/image_file.gif',
            :disposition => 'inline',
            :type => 'image/gif',
            :stream => false,
            :filename => 'private_file.gif' )

-Rob