Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Feature request: filename in URL #22

parndt opened this Issue · 7 comments

4 participants


By default dragonfly urls don't end with an extension for the file they are representing e.g.:

This causes things like lightbox scripts to fail because they are looking for extensions.

A better URL is something like this:


We have managed to achieve this in Refinery CMS using this wee instance_eval:

It'd be nice to have core support for this, maybe as an option passed to the dragonfly configuration that puts the filename at the end by default. As it is, we have to get it using the job.steps where we look for one with step_name :fetch.


Hi - there is core support for this! :)
see 'suffix' bit of


Ah excellent! Thanks Mark ;)


Hey Mark, I'm trying to get the original filename on the url too, to detect it in tests... But haven't managed to use the suffix proc example on the docs. What's the proper Rails 3 route that would go with that config?


hi - I'm currently working on making this easier as at the moment it's a bit tricky having the original filename available at the time that you generate the url.

In the meantime, the best way is probably to pass the name in each time as a suffix
image.url(:suffix => name)
where name has been saved on your model (you can just add the attachment_name column and it should just work) and then wrap this in a helper.

if you use Rails 3 routes you'd need to have all the necessary information in the url - what kind of thing are you using it for? is it standard image thumbnails for a model attachment?


yes, image thumbs for a model attachment, only accessed from an iphone app

adding attachment_name works well :) thanks (tried embedding but it didn't render ?)


cool - hopefully when I've done with the refactoring you won't need the helper :)


Hi @markevans , any update on this feature?
Actually what I had more in mind is to get the absolute file path of a previously uploaded image

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.