I have some image files under /app /uploads /images/ 111.jpg /public /images . . How can I user image_tag to display the images under /uploads/images/...? Any hints? -- Jochen Kaechelin gissmoh.de, figgfrosch.de, ror-ror.de --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jochen kaechelin wrote:> I have some image files under > > /app > /uploads > /images/ > 111.jpg > > /public > /images > > . > . > > How can I user image_tag to display the images under > /uploads/images/...? > > > Any hints? > > >Hi Jochen, you can create symlink in public dir that would point to uploads. -- Bojan Mihelac -> Ruby on Rails and Web Developer Blog : http://source.mihelac.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bojan Mihelac schrieb:> jochen kaechelin wrote: >> I have some image files under >> >> /app >> /uploads >> /images/ >> 111.jpg >> >> /public >> /images >> >> . >> . >> >> How can I user image_tag to display the images under >> /uploads/images/...? >> >> >> Any hints? >> >> >> > Hi Jochen, > you can create symlink in public dir that would point to uploads.ButBut the files must be protected...when I create a syslink everyone is able to access them! Right? -- Jochen Kaechelin gissmoh.de, figgfrosch.de, ror-ror.de --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
protected from what? In what cases do you want users to be able to view these images? Adam On 7/23/07, jochen kaechelin <gissmoh-Vg5pTm5GbeLoK6nBLMlh1Q@public.gmane.org> wrote:> > Bojan Mihelac schrieb: > > jochen kaechelin wrote: > >> I have some image files under > >> > >> /app > >> /uploads > >> /images/ > >> 111.jpg > >> > >> /public > >> /images > >> > >> . > >> . > >> > >> How can I user image_tag to display the images under > >> /uploads/images/...? > >> > >> > >> Any hints? > >> > >> > >> > > Hi Jochen, > > you can create symlink in public dir that would point to uploads.But > > But the files must be protected...when I create a syslink everyone > is able to access them! Right? > > > -- > Jochen Kaechelin > gissmoh.de, figgfrosch.de, ror-ror.de > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Cohen schrieb:> protected from what? In what cases do you want users to be able to > view these images?Only logged in users are able to view the files. When I store the images under /public/images/111.jpg everyone is able to view the images. But I thing I got a soultion: send_file RAILS_ROOT + "/downloads/#{params[:galery_id]}/#{params[:filename]}", :type => "image/jpeg", :disposition => ''inline''> Adam > > On 7/23/07, jochen kaechelin <gissmoh-Vg5pTm5GbeLoK6nBLMlh1Q@public.gmane.org> wrote: >> Bojan Mihelac schrieb: >>> jochen kaechelin wrote: >>>> I have some image files under >>>> >>>> /app >>>> /uploads >>>> /images/ >>>> 111.jpg >>>> >>>> /public >>>> /images >>>> >>>> . >>>> . >>>> >>>> How can I user image_tag to display the images under >>>> /uploads/images/...? >>>> >>>> >>>> Any hints? >>>> >>>> >>>> >>> Hi Jochen, >>> you can create symlink in public dir that would point to uploads.But >> But the files must be protected...when I create a syslink everyone >> is able to access them! Right? >> >> >> -- >> Jochen Kaechelin >> gissmoh.de, figgfrosch.de, ror-ror.de >> > > > >-- Jochen Kaechelin gissmoh.de, figgfrosch.de, ror-ror.de --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jochen kaechelin wrote:> Adam Cohen schrieb: >> protected from what? In what cases do you want users to be able to >> view these images? > > > Only logged in users are able to view the files. > > When I store the images under /public/images/111.jpg > everyone is able to view the images. > > But I thing I got a soultion: > > send_file RAILS_ROOT + > "/downloads/#{params[:galery_id]}/#{params[:filename]}", :type => > "image/jpeg", :disposition => ''inline'' > >beware that send_file keep files in memory until they are downloaded, so that means you could get in trouble with big files or many downloads at time. Bojan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can also use the X-Sendfile header to send non-publicly accessible files through the web server (providing that it supports this header), without tying up your rails process. You can read more about it here: http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ http://blog.lighttpd.net/articles/2006/07/22/mod_proxy_core-got-x-sendfile-support Adam The following may be of use to you: http://blog.lighttpd.net/articles/2006/07/22/mod_proxy_core-got-x-sendfile-support On 7/24/07, Bojan Mihelac <lists-3SxN1WY3PMJAfugRpC6u6w@public.gmane.org> wrote:> > jochen kaechelin wrote: > > Adam Cohen schrieb: > >> protected from what? In what cases do you want users to be able to > >> view these images? > > > > > > Only logged in users are able to view the files. > > > > When I store the images under /public/images/111.jpg > > everyone is able to view the images. > > > > But I thing I got a soultion: > > > > send_file RAILS_ROOT + > > "/downloads/#{params[:galery_id]}/#{params[:filename]}", :type => > > "image/jpeg", :disposition => ''inline'' > > > > > > beware that send_file keep files in memory until they are downloaded, so > that means you could get in trouble with big files or many downloads at > time. > > Bojan > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Cohen wrote:> You can also use the X-Sendfile header to send non-publicly accessible > files through the web server (providing that it supports this header), > without tying up your rails process. You can read more about it here: > > http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ > http://blog.lighttpd.net/articles/2006/07/22/mod_proxy_core-got-x-sendfile-support > > Adam >or create own x-send_file method that would create symlink with unique name and redirect logged user to it. Clear can be done with cronjob. -- Bojan Mihelac -> Ruby on Rails and Web Developer Blog : http://source.mihelac.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---