Dynamic attributes and file uploads

I’m building a multitentant CMS and file uploads are a central part of it. I have no issues uploading files when I’ve already specified a file field in my schema, the problem is that certain pages require dynamic, NoSQL style attributes - a feature which is made possible thanks to postgres hstore. This allows me to create custom fields on the fly (user specifies custom fields in the admin backend) but I can’t figure out how to flag certain fields so the controller handles them as attachments.

Ideally I’d like the controller to check if an attribute name contains the word “photo” or “attachment” and have it processed accordingly, but I have no idea how to parse the params, or if this is even the best solution.

Any ideas?

1 Like