Modifying settings UIkit upload using jquery after init
<p>Im working on a file upload function using UIkit. On a webpage I have multiple items on which users can post a file. Each item has a different ID.</p>

<p>What I want is that for each item, the files get in a folder named by the item id. But when the UIkit.uploadSelect is initialized, I cannot modify the params anymore.</p>

<p>When I press on a item; a onclick event is fired on function: GetTaskInfo();</p>

<p>I tried so many things, but still without success.</p>

<p>Any help is appreciated.</p>

<p>File upload function (call to UIkit):</p>

<pre><code>function Upload(id) {
    var progressbar = $("#task_info_progressbar"),
        bar = progressbar.find('.uk-progress-bar'),
        settings = {

            action: '/Scrum/Upload', // upload url

            params: {
                folder: "scrum",
                id: id
            },

            allow: '*.(zip)', // allow only zip files

            filelimit: 1,

            beforeAll: function (files) {

            },
            loadstart: function () {
                bar.css("width", "0%").text("0%");
                progressbar.removeClass("uk-hidden");
            },
            progress: function (percent) {
                percent = Math.ceil(percent);
                bar.css("width", percent + "%").text(percent + "%");
            },
            error: function () {

            },
            abort: function () {

            },
            allcomplete: function (response) {
                bar.css("width", "100%").text("100%");

                setTimeout(function () {
                    progressbar.addClass("uk-hidden");
                }, 250);

            });
            }
        };

    var select = UIkit.uploadSelect($("#task_info_file_select"), settings),
        drop = UIkit.uploadDrop($("#task_info_file_drop"), settings);
}
</code></pre>

<p>The function when a user opens an item.</p>

<pre><code>function GetTaskInfo(id) {
   task_id = $('#task_id');
   Upload(task_id);
}
</code></pre>

<p>UIkit upload function (<a href="http://getuikit.com/docs/upload.html" rel="nofollow">http://getuikit.com/docs/upload.html</a>)</p>

<pre><code>})(function(UI){

"use strict";

UI.component('uploadSelect', {

    init: function() {

        var $this = this;

        this.on("change", function() {
            xhrupload($this.element[0].files, $this.options);
            var twin = $this.element.clone(true).data('uploadSelect', $this);
            $this.element.replaceWith(twin);
            $this.element = twin;
        });
    }
});

UI.component('uploadDrop', {

    defaults: {
        'dragoverClass': 'uk-dragover'
    },

    init: function() {

        var $this = this, hasdragCls = false;

        this.on("drop", function(e){

            if (e.dataTransfer &amp;&amp; e.dataTransfer.files) {

                e.stopPropagation();
                e.preventDefault();

                $this.element.removeClass($this.options.dragoverClass);
                $this.element.trigger('dropped.uk.upload', [e.dataTransfer.files]);

                xhrupload(e.dataTransfer.files, $this.options);
            }

        }).on("dragenter", function(e){
            e.stopPropagation();
            e.preventDefault();
        }).on("dragover", function(e){
            e.stopPropagation();
            e.preventDefault();

            if (!hasdragCls) {
                $this.element.addClass($this.options.dragoverClass);
                hasdragCls = true;
            }
        }).on("dragleave", function(e){
            e.stopPropagation();
            e.preventDefault();
            $this.element.removeClass($this.options.dragoverClass);
            hasdragCls = false;
        });
    }
});
</code></pre>