You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation states that it's possible to change the filename with the filename function:
It may be undesirable to retain original filenames (eg, it may contain personally identifiable information, vulgarity, vulnerabilities with Unicode characters, etc).
You may specify the destination filename for uploaded versions through your definition module.
For our use case we want to replace the uploaded filename with something randomly generated (not derived from the original filename). I have noticed that that the filename function is used to both generate new filenames and create publicly accessible urls... From what I can see this is problematic when the filename function contains data that is not derivable from the original filename. For example this is the implementation of our filename function:
This correctly creates a filename with now + token but when I ask for the url I get something completely random because it invokes filename again.
Am I doing this correctly? Is there a different API I should be using? Have I misunderstood the documentation?
I am using ecto-arc so I know the correct filename - I am thinking of reimplementing this functionality by only calling filename when storing the image and passing through for urlor separating store_filename vs url_filename.
It's possible that this functionality already exists and I'm just missing it somewhere.
Thanks
The text was updated successfully, but these errors were encountered:
The documentation states that it's possible to change the filename with the
filename
function:For our use case we want to replace the uploaded filename with something randomly generated (not derived from the original filename). I have noticed that that the
filename
function is used to both generate new filenames and create publicly accessible urls... From what I can see this is problematic when thefilename
function contains data that is not derivable from the original filename. For example this is the implementation of ourfilename
function:This correctly creates a filename with
now
+token
but when I ask for the url I get something completely random because it invokesfilename
again.Am I doing this correctly? Is there a different API I should be using? Have I misunderstood the documentation?
I am using ecto-arc so I know the correct filename - I am thinking of reimplementing this functionality by only calling
filename
when storing the image and passing through forurl
or separatingstore_filename
vsurl_filename
.It's possible that this functionality already exists and I'm just missing it somewhere.
Thanks
The text was updated successfully, but these errors were encountered: