#Stop same image file upload
12 messages · Page 1 of 1 (latest)
i dont think so
maybe if you add a filter hook, generate a checksum or something but i dont think that works 100%
Yes, but a simple system check on actual upload would a great directus enhancement.
create a GH discission i guess
by using this filter hook it would be technically be possible, e.g. by storing the md5 of each file uploaded along with the actual file. You should be able to set this up by Flows with very few lines of code
The flow can be used as blocking (filter) and runs the Script operations to generate any hash on the fly.
afterwards, search for this hash in the target collection, if results is emtpy, save the newly posted item and store the hash as additional field.
Via the flow interface it is not possible to select the files.upload event for a filter -- only actions can be triggered by this event.
Is is possible to use the files.upload event when creating such a flow manually (e.g. via API)?
You can raw edit the scope field and write files.upload inside, it might work. Consider it more as a hack because it breaks the ui in some ways, for example when you try to edit something later, collection checkboxes appear disabled until you set an event from the dropdown.
but what about a trigger of new items within the system collection directus_files?
I tried that "accidentally" because I hadn't realized yet that there is a files.upload event for actions.
Unfortunately using item.created on the directus_files collection never triggered my flow. Not sure what went wrong there.
Can you confirm that this is working for you? This would be the way to go for a filterable approach.