Send custom data with dropzone.js on each File Upload

前端 未结 4 1392
孤独总比滥情好
孤独总比滥情好 2020-12-23 19:38

I am using dropzone in my Code Igniter Project.

With every drag of a file, dropzone creates an ajax request and my files is getting stored on the server too. But now

4条回答
  •  死守一世寂寞
    2020-12-23 20:19

    Abhinav has the right and working answer I only want to give a second option to use it in the options object (for example if you have multiple Dropzone sections on one page.)

    myDropzone.options.dropzoneDivID = {
        sending: function(file, xhr, formData){
            formData.append('userName', 'Bob');
        }
    };
    

提交回复
热议问题