Is it possible to generate a UUID for uploadPath on fileUpload components? | Community
Skip to main content
New Participant
November 27, 2023

Is it possible to generate a UUID for uploadPath on fileUpload components?

  • November 27, 2023
  • 1 reply
  • 815 views

I have a situation where there is an image uploaded to a page with the cq/gui/components/authoring/dialog/fileupload component using the uploadUrl property = ${suffix.path}. This image gets cached (based on our dispatcher rules) for 2 hours, which is fine. However, when the image gets swapped out for a new one, we have to wait upwards of 2 hours for it to change because the file name is not updated. It would be nice to keep the long cache of this image, but bust it when the image changes. One way to do this would be to add a version number or UUID of some sort to the upload file name. Is this possible in the cq:dialog XML? Something like 

uploadUrl="${suffix.path}.${generate.uuid}"

would be nice in this situation.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Employee
December 5, 2023

@arunpatidar @estebanbustamante @mahedi_sabuj @a_h_m_imrul 

@shaileshbassi @sady_rifat @aanchal-sikka Can you please review this unanswered question? Appreciate your thoughts on this.

Kautuk Sahni
New Participant
December 5, 2023

I will note that something I thought about after posting this question was that, if we had such a function, it may bloat the DAM with tons of files instead of replacing the same one, so may not be a desired solution anyway.