0

How can I download a file located on a remote website (a download link is available or an address to an actual file on the remote server) to the server running the rails application? The file needs to be stored in a specific folder in the server file system.

Itay k
  • 4,163
  • 4
  • 31
  • 39

2 Answers2

2

Let's do it step by step:

  1. Use the carrierwave

    in your Gemfile:

    gem 'carrierwave'

  2. in your view

    <%= f.text_field :remote_image_url %>

  3. in your model

    attr_accessible :remote_image_url

More detail you can check Ryan's railscast#253 CarrierWave File Uploads

Kuo Jimmy
  • 801
  • 5
  • 13
0

You could use Carrierwave as an upload plugin and use its Uploading files from a remote location feature to upload something via a URL.

Tim Brandes
  • 2,103
  • 15
  • 14