BalaRaju Vankala
2012-Oct-16 11:30 UTC
how to display the images in browser other than the storage path i.e.., public folder (ASAP)
hi i am having a doubt in changing the path for attached file i.e..,for uploading photos and files ..by default the path is ":rails_root/public/system/" and i want to change the path as ~/apps/Blog/data/attached/ BLOG refers to my project app name after making the changes the image or file i saving but it is not displaying in the browser can any one help me out in writing the correct PATH and URL these are modified Path and Url has_attached :photo, path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename" thanks in advance who ever help me -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2012-Oct-16 12:31 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
On 16 October 2012 12:30, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hi i am having a doubt in changing the path for attached file i.e..,for > uploading photos and files ..by default the path is > ":rails_root/public/system/" and i want to change the path as > ~/apps/Blog/data/attached/ > > BLOG refers to my project app name > > after making the changes the image or file i saving but it is not displaying > in the browser > > can any one help me out in writing the correct PATH and URL > > these are modified Path and Url > > has_attached :photo, > path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", > url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename"Normally in a rails app only files under your_app/public are accessible directly. If you want to access files elsewhere then you will have to do clever things with apache or other webserver to achieve this. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
BalaRaju Vankala
2012-Oct-16 12:47 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
i didnt get you... how to change paper clip default url .... On Tue, Oct 16, 2012 at 6:01 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 16 October 2012 12:30, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > hi i am having a doubt in changing the path for attached file i.e..,for > > uploading photos and files ..by default the path is > > ":rails_root/public/system/" and i want to change the path as > > ~/apps/Blog/data/attached/ > > > > BLOG refers to my project app name > > > > after making the changes the image or file i saving but it is not > displaying > > in the browser > > > > can any one help me out in writing the correct PATH and URL > > > > these are modified Path and Url > > > > has_attached :photo, > > path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", > > url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename" > > Normally in a rails app only files under your_app/public are > accessible directly. If you want to access files elsewhere then you > will have to do clever things with apache or other webserver to > achieve this. > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- నేను కొంచం తపన, కాస్త ఆసక్తి, కొన్ని కలలు, కాసిన్ని ఊహలు కలిపేస్తే నేను -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2012-Oct-16 12:57 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
On 16 October 2012 13:47, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i didnt get you... how to change paper clip default url ....Please don''t top post, it makes it difficult to follow the thread. Insert your reply at appropriate points in the previous message. Thanks. I don''t use paperclip but my understanding that it is not normally possible to save outside of the public folder. Colin> > On Tue, Oct 16, 2012 at 6:01 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 16 October 2012 12:30, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > >> > hi i am having a doubt in changing the path for attached file i.e..,for >> > uploading photos and files ..by default the path is >> > ":rails_root/public/system/" and i want to change the path as >> > ~/apps/Blog/data/attached/ >> > >> > BLOG refers to my project app name >> > >> > after making the changes the image or file i saving but it is not >> > displaying >> > in the browser >> > >> > can any one help me out in writing the correct PATH and URL >> > >> > these are modified Path and Url >> > >> > has_attached :photo, >> > path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", >> > url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename" >> >> Normally in a rails app only files under your_app/public are >> accessible directly. If you want to access files elsewhere then you >> will have to do clever things with apache or other webserver to >> achieve this. >> >> Colin >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > > -- > నేను > కొంచం తపన, > కాస్త ఆసక్తి, > కొన్ని కలలు, > కాసిన్ని ఊహలు కలిపేస్తే > నేను > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Jordon Bedwell
2012-Oct-16 13:03 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
On Tue, Oct 16, 2012 at 7:57 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> I don''t use paperclip but my understanding that it is not normally > possible to save outside of the public folder.Add the path to your assets: config.assets.paths.push(File.expand_path("~/my/path")) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Jim Ruther Nill
2012-Oct-16 13:04 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
On Tue, Oct 16, 2012 at 8:47 PM, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> i didnt get you... how to change paper clip default url .... > > On Tue, Oct 16, 2012 at 6:01 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> On 16 October 2012 12:30, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > >> > hi i am having a doubt in changing the path for attached file i.e..,for >> > uploading photos and files ..by default the path is >> > ":rails_root/public/system/" and i want to change the path as >> > ~/apps/Blog/data/attached/ >> > >> > BLOG refers to my project app name >> > >> > after making the changes the image or file i saving but it is not >> displaying >> > in the browser >> > >> > can any one help me out in writing the correct PATH and URL >> > >> > these are modified Path and Url >> > >> > has_attached :photo, >> > path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", >> > url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename" >> >Colin is 50% right. You can use send_data to use rails to send files which are not in the public folder or, as Colin suggested, use apache to serve them. But for your specific question, you should look at https://github.com/thoughtbot/paperclip#understanding-storage :path option is where you save the file :url option is the url used to access the image to use this in a view, use the url method image_tag blog.photo.url> >> Normally in a rails app only files under your_app/public are >> accessible directly. If you want to access files elsewhere then you >> will have to do clever things with apache or other webserver to >> achieve this. >> >> Colin >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > -- > నేను > కొంచం తపన, > కాస్త ఆసక్తి, > కొన్ని కలలు, > కాసిన్ని ఊహలు కలిపేస్తే > నేను > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2012-Oct-16 13:07 UTC
Re: how to display the images in browser other than the storage path i.e.., public folder (ASAP)
On 16 October 2012 14:04, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tue, Oct 16, 2012 at 8:47 PM, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8@public.gmane.orgm> > wrote: >> >> i didnt get you... how to change paper clip default url .... >> >> On Tue, Oct 16, 2012 at 6:01 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >>> >>> On 16 October 2012 12:30, BalaRaju Vankala <foreverbala4u-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>> > >>> > hi i am having a doubt in changing the path for attached file >>> > i.e..,for >>> > uploading photos and files ..by default the path is >>> > ":rails_root/public/system/" and i want to change the path as >>> > ~/apps/Blog/data/attached/ >>> > >>> > BLOG refers to my project app name >>> > >>> > after making the changes the image or file i saving but it is not >>> > displaying >>> > in the browser >>> > >>> > can any one help me out in writing the correct PATH and URL >>> > >>> > these are modified Path and Url >>> > >>> > has_attached :photo, >>> > path: ~/apps/Blog/data/attached/:attachment/:id/:style/:filename", >>> > url: /~/apps/Blog/data/attached/:attachment/:id/:style/:filename" > > > Colin is 50% right.Better than 0% I suppose :) Colin> You can use send_data to use rails to send files which > are not in the public folder or, as Colin > suggested, use apache to serve them. > > But for your specific question, you should look at > https://github.com/thoughtbot/paperclip#understanding-storage > > :path option is where you save the file > :url option is the url used to access the image > > to use this in a view, use the url method > > image_tag blog.photo.url > >>> >>> >>> Normally in a rails app only files under your_app/public are >>> accessible directly. If you want to access files elsewhere then you >>> will have to do clever things with apache or other webserver to >>> achieve this. >>> >>> Colin >>> >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> >> >> -- >> నేను >> కొంచం తపన, >> కాస్త ఆసక్తి, >> కొన్ని కలలు, >> కాసిన్ని ఊహలు కలిపేస్తే >> నేను >> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.