hayageek / jquery-upload-file

jQuery Upload File plugin provides Multiple file Uploads with progress bar.Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
http://hayageek.com/
MIT License
682 stars 417 forks source link

JQuey-upload-file update formData is not working #199

Open diegoalbgr opened 4 years ago

diegoalbgr commented 4 years ago

Hi, I have been trying to update the formData with the option "update" but when I update, it keep the old information.

This is my code:

var filesDataObj;

filesDataObj = $("#fileuploader").uploadFile({
            url: "someURL",
            multiple: true,
            dragDrop: true,
            fileName: "mallFiles",
            autoSubmit: false,
            formData: { "userID": 6, "statusID": 20 },
            onError: function (files, status, errMsg, pd) {
                console.log("Error: ");

                console.log(status);

                console.log(errMsg);
            }
        });

filesDataObj.update({

            formData: {
                "patientID": parseInt($("#patient_id").val()),
                "appointmentID": hospitalResponse.HospitalData.patientAppointment
            }

        });

Also thanks for the plugin, it still works in 2020 :+1:

yuranikspb commented 4 years ago

i check this function and it work some thing else wrong

this.update = function (settings) {
            //update new settings
        s = $.extend(s, settings);
            //We need to update action for already created Form.            
            if(settings.hasOwnProperty('url'))
            {
                $("form").each(function(i,items)
                {
                    $(this).attr('action',settings['url']);
                });
            }

        }