简体   繁体   中英

plupload changing multi params defore upload

I need to change deposit_id before upload I have read you can bind multipart parameters but i cannot figure out where Any suggestions? I have included my upload code which works fine I am using 3.5.1

        BeforeUpload: function (up, files) {
            var date='date='+$("#element_1_3").val()+'-'+$("#element_1_1").val()+'-'+$("#element_1_2").val()+"&deposit_id="+$("#deposit_id").val()+"&year="+$("#element_1_3").val();
        //  up.settings.multipart_params = {Anewid: "2"}
        //  DEPOSITImageUploader.settings.multipart_params.type = $("#deposit_id").val();





            console.log(up);
            console.log("BEFORE UPLOAD "+date);
        },

I figured out that i can extend the POST parameters by defining setting and params as the uploader which in this case was DEPOSITImageUploader It now updates the POST every time

                var settings = DEPOSITImageUploader.settings;
            var params = settings.multipart_params;
            $.extend(up.settings.params, { deposit_id : $('#deposit_id').val() }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM