On Apr 6, 7:55 am, Tushar Gandhi
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi,
> I am facing a problem to copy the file.
>
> I am getting path of the file like this
>
"http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457...".
> I want to copy this file locally. I am trying to do this by using
>
>
File.copy("http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457...","/images");
>
> I am getting an error
> Invalid argument
-http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457...
>
> I know that this is not a directory path. Is any one knows how to copy
> this file?
>
File.copy only understands paths to files on your machine. To get one
from an http url you need to use net/http, openuri etc.
Fred> Thanks
> Tushar
> --
> Posted viahttp://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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---