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.
3d9e26d3be3e7fcf93aca6574bc77a20?d=identicon&s=25 Tushar Gandhi (gandhi-tush)
on 2009-04-06 08: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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-06 09:45
(Received via mailing list)
On Apr 6, 7:55 am, Tushar Gandhi <rails-mailing-l...@andreas-s.net>
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.