Forum: Ruby on Rails Serving image files from filesystem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
19b37b73fe93dde165adf38543c58dee?d=identicon&s=25 Mike Lecza (Guest)
on 2006-01-09 19:11
(Received via mailing list)
I'm pretty new to Ruby and Rails.  I am writing a Rails application

that is meant to be run on a local machine.  It allows the user to

select a bunch of image (jpg, gif, etc)  files from anywhere on their

file system and add them to an album.



The prototype of the is app is going to leave the images where they are

on the disk (and not persist them anywhere else).  I want to write a

controller that can take an image name and location on disk as a

parameter and then serve the file to the user via the WEBrick server so

that the image appears properly in the browser.



Is there any sample code anywhere for opening a binary file and serving

it as jpg (or whatever) to the user?



Regards
This topic is locked and can not be replied to.