Read the documentation for your file upload package -- I believe you mentioned ActiveStorage -- about uploading from a URL. This is a common feature in many file attachment systems. CarrierWave, Shrine, CarrierWave, even Paperclip have a way to do this.
It usually amounts to something like
require 'open-uri'
file = open(remote_url).read
@your_instance.file = file
@your_instance.save # (the file should be persisted locally)
Walter
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/9f8ba9af-0ad0-4fd0-856b-0f236c76149b%40googlegroups.com.