Skip to content

How to specify metadata filename for downloaded file? #683

Answered by adam12
aaricpittman asked this question in Q&A
Discussion options

You must be logged in to vote

Untested, but you might need to go directly through the attacher for this.

url = "https://example.org/file"
image = Image.new
image.file_attacher.attach(Down.open(url), metadata: { filename: File.basename(url) })

Alternatively the remote_url plugin?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aaricpittman
Comment options

Answer selected by aaricpittman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants