Luci upload functionality

I want to implement a file upload feature using LuCI.ui.FileUpload, but I'm not sure how to restrict the file upload size to no more than 100KB and only allow TXT files to be uploaded.
below is the sample code

'use strict';
'require view';
'require form';

return view.extend({
    render: function() {
        var m, s, o;

        m = new form.Map('example', _('Example Form'), _('Example Form Configuration.'));

        s = m.section(form.TypedSection, 'first', _('First Section'));
        s.anonymous = true;
        s.option(form.Value, 'first_option', _('First Option'), _('Input for the first option'));

        s = m.section(form.TypedSection, 'second', _('Second Section'));
        s.anonymous = true;

        o = s.option(form.Flag, 'flag', _('Flag Option'), _('A boolean option'));
        o.default = '1';
        o.rmempty = false;

        o = s.option(form.ListValue, 'select', _('Select Option'), _('A select option'));
        o.placeholder = 'placeholder';
        o.value('key1', 'value1');
        o.value('key2', 'value2');
        o.rmempty = false;
        o.editable = true;

        // Add file upload section
        s = m.section(form.TypedSection, 'first', _('Upload Section'));
        s.anonymous = true;

        o = s.option(form.FileUpload, 'file', _('Upload File'), _('Choose a file to upload'));


        return m.render();
    },
});

The FileUpload doesn't have such ability to limit a size.
There must be a global limit on the web server (uhttpd) or in the cgi-io.

Why do you want this limitation?

I made adjustments to form.js and ui.js, and the changes worked successfully. It was customer requirement they wanted user to restrict the file size not greater than 100kb and do not want to allow any other file formats other than .txt.

doesn't really say anything about the content though ...