module CarrierWave::Uploader::Download

Public Instance Methods

download!(uri) click to toggle source

Caches the file by downloading it from the given URL.

Parameters

url (String)

The URL where the remote file is stored

# File lib/carrierwave/uploader/download.rb, line 47
def download!(uri)
  unless uri.blank?
    file = RemoteFile.new(uri)
    raise CarrierWave::DownloadError, "trying to download a file which is not served over HTTP" unless file.http?
    cache!(file) 
  end
end