Change upload handler to use a template inside var.