title: Download file in service object with ActiveStorage
body: <p>A user uploads a document and this gets stored in Azure with ActiveStorage. The next step is that the backend processes this and therefore I have a service object to do this. So I need to download the file from Azure to the <code>tmp</code> folder within the Rails app. How do I download the file? I cannot use <code>rails_blob_url</code> because it is not available in a service object, only in controllers and views.</p>
  
  <p>When I still used Paperclip I did something like this:</p>
  
  <pre><code>require 'open-uri'
  file = Rails.root.join('tmp', user.attachment_file_name)
  name = user.attachment_file_name
  download = open(user.attachment.url)
  download_result = IO.copy_stream(download, file)
  </code></pre>
  
  <p>How can I do something similar with ActiveStorage?</p>