I have a div with various images in a grid which is populated when the pages loads and use Fancybox-3 to enable zoom and download functions when an image is clicked.
When the file is uploaded I add an 8 digit random hash to the beginning to ensure there are no duplicates and need this 8 digit hash removed on download so that the user gets the file with the same name it was uploaded with. I've searched various sources and can't find an answer
But where is the problem? Did you try anything? Did you not know that fancybox (like most of js scripts/libraries) provides a rich API so you can easily 1) execute your code using callbacks? 2) access dom elements?
Example:
https://codepen.io/anon/pen/KxGLar?editors=1010