Active Storage uploading files from a remote location

How to add ability to upload image via URL?

ActiveStorage accepts a file as a parameter, so all you need do is get an IO handle to the remote file, something like this:

require 'open-uri' remote = open('url/to/file').read @my_parent_object.file = remote @my_parent_object.save

Walter