def patch(self):
        req_op = self.get_argument('op')
        req_path = self.get_argument('path')
        req_value = self.get_argument('value', None)
        req_from = self.get_argument('from', None)
        direct_upload = self.get_argument('direct_upload', False)

        if direct_upload and direct_upload == 'true':
            direct_upload = True

            with NamedTemporaryFile(suffix='.txt', delete=False) as fp:
                fp.write(self.request.files['value'][0]['body'])
                req_value = fp.name

        self.write(sample_template_handler_patch_request(
            self.current_user, req_op, req_path, req_value, req_from,
            direct_upload))