Is there any way to rename files upon there upload to an assets field?

I know I can hit the options of the file and rename manually, but was wondering if there was a way to do this automatically? i.e. renamed based on the entry ID.

1 Answer 1


Craft has the ability to dynamically add subfolder paths to Assets when you are creating the Asset field in the control panel.

Tags like {slug} and {author.username} are some of the available options for creating the directories.

I know it has been brought up before and they have acknowledged the possibility. So who knows, maybe we will see it in 2.2?

For now, if organization is a concern I recommend using subfolders to keep it clean.

asset field options

  • 1
    Yes, I've set dynamic folder locations which is really useful. It's probably just the OCD side in me, but my files (images) will come from a wide range of sources, from different users etc, so I'd rather the files have consistent naming.
    – shorn
    Commented Jul 15, 2014 at 8:49
  • Agreed, I am the same way and was one who asked this very question. I don't know what the have planned for 2.2 but I have a "feeling" a lot of great things for assets will be coming out with it ;) Commented Jul 15, 2014 at 9:03
  • Here's hoping! I'd love to (for example) rename the files with the kind of flexibility there is in setting upload location. Fingers crossed. :)
    – shorn
    Commented Jul 15, 2014 at 9:05
  • These guys always have a few tricks up their sleeves... I'm sure it will be another great release - on both developer and feature fronts. Commented Jul 15, 2014 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.