Model like :
@Entity
public class Doc extends Model {
public Blob tpl;
}
Controller like:
public class DocController extends Controller {
public static void saveDoc(@Required Blob tpl){
render(); // event no persistence operation
}
}
It will have 2 uploaded file in the data/attachments. even there are no persistence operation in the controller action.
You can pass the Doc object directly into your action (use
doc.tplfrom the view, rather than justtpl), and then perform the validation on the Object, rather than the Blob itself.