So an update to this just been playing around, it doesn’t look as though you can add a regex pattern into a constraint. So the only way you can do this is to save the file ending into the database long with the file. So that you can then add a constraint to say that the filetype must equal .png or whatever.
Unfortnatley I don’t think the contains argument will work as it would need to be a full word so you couldn’t use that on the file type thats saved by default in the database (as far as I can see) as it will be a string like s3://something/or/other/myfilename.png so the contains argument wont work on that as the whole word is “s3://something/or/other/myfilename.png” I believe this is due to scalability issues doing part word searches. However as you are uploading files if you can grab the type using regex and then save it in th DB then do a contains on the file ending.
Hope that makes sense and if I am wrong about any of this I apologise only been here a week! So please let me know