In my application users can upload images from the local machine. But I also want to provide them to upload their images by telling the app the full url to the an image on the web. How do I save the image on the local machine from the url. Thanks -- Posted via http://www.ruby-forum.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-/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 -~----------~----~----~----~------~----~------~--~---
On Dec 4, 2007 2:43 PM, Raj Singh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > In my application users can upload images from the local machine. But I > also want to provide them to upload their images by telling the app the > full url to the an image on the web. How do I save the image on the > local machine from the url.require ''net/http'' Net::HTTP.start( ''static.destiney.com'' ) { |http| resp = http.get( ''/ror_vs_c_asm.jpg'' ) open( ''/tmp/ror_vs_c_asm.jpg'', ''wb'' ) { |file| file.write(resp.body) } } -- Greg Donald http://destiney.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-/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 -~----------~----~----~----~------~----~------~--~---
Raj Singh wrote:> In my application users can upload images from the local machine. But I > also want to provide them to upload their images by telling the app the > full url to the an image on the web. How do I save the image on the > local machine from the url. > > ThanksHi Raj, It delayed reply but Useful one. Now it was available as a desktop application. goto --> http://www.box.net/shared/m5vxqpr3r1 Regards, P.Raveendran http://raveendran.wordpress.com -- Posted via http://www.ruby-forum.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-/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 -~----------~----~----~----~------~----~------~--~---