Archived from the Transloadit support forum. Originally posted on March 10, 2011; details may be outdated, see our docs for current behavior. Original thread
It would be great if I could specify a set of rules (similar to configuring templates) that can be passed to an assembly with a ‘rule_id’. This would replace the ‘template_id’. On your servers, you parse the instructions and choose the appropriate template. For example…
{
"type": {
"image": "template_id"
, "video": "template_id"
}
}
This would be very helpful for my current situation. I would like the user to be able to upload any kind of file from the same form, but different types get processed differently. I can do a superficial file type check client-side, but that’s bogus. Otherwise I can move everything server side and do the type checking there, then use curl to talk to transloadit.com… but that means two file uploads instead of one.
Of course, I can just flip the file input field based on a radio input for upload type… but it would be slick if that was not needed ![]()
Just a thought. I think there would be other more complex use cases as well, beyond file types. Combing rules, etc…
Thanks and Best,
Sander