Forum: Ruby on Rails Problem in copying file

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.
Tushar G. (Guest)
on 2009-04-06 10:55
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/....
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/...

I am getting an error
Invalid argument -
http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/...

I know that this is not a directory path. Is any one knows how to copy
this file?

Thanks
Tushar
Frederick C. (Guest)
on 2009-04-06 11:45
(Received via mailing list)
On Apr 6, 7:55 am, Tushar G. <removed_email_address@domain.invalid>
wrote:
> Invalid argument 
-http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/......
>
> 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
This topic is locked and can not be replied to.