Open ramoneariel opened 6 years ago
I need to upload multiple files, but the headers are not refreshed, send the same for all
`<script type="text/javascript> var token = "string"; var auth = "string";
$("#drop-area").dmUploader({ url: '/upload-file', maxFileSize: 10000000, // 10M auto: false, queue: true, extraData: function() { return { "folder_id": inFolder }; }, headers: { 'X-CSRF-TOKEN': token, 'X-CSRF-AUTH': auth }, onDragEnter: function(){ this.addClass('blue inverted'); }, onDragLeave: function(){ this.removeClass('blue inverted'); }, onNewFile: function(id, file){ this.removeClass('blue inverted'); $("#added_files").show(); add_file(id, file); }, onUploadProgress: function(id, percent){ file_progress(id, percent); }, onUploadError: function(id, xhr, status, message){ swal("", message, "error"); }, onFallbackMode: function(){ swal("", "Error.", "error"); }, onFileSizeError: function(file){ swal("",".", "error"); }, onComplete: function(){ location.reload(); }, onUploadSuccess: function(id, data) { var d = $.parseJSON(dat); token = d.data.CSRF_TOKEN; auth = d.data.CSRF_AUTH; if(!data.status){ swal('', data.msg, 'error'); }
} });
`
I need to upload multiple files, but the headers are not refreshed, send the same for all
`<script type="text/javascript> var token = "string"; var auth = "string";
$("#drop-area").dmUploader({ url: '/upload-file', maxFileSize: 10000000, // 10M auto: false, queue: true, extraData: function() { return { "folder_id": inFolder }; }, headers: { 'X-CSRF-TOKEN': token, 'X-CSRF-AUTH': auth }, onDragEnter: function(){ this.addClass('blue inverted'); }, onDragLeave: function(){ this.removeClass('blue inverted'); }, onNewFile: function(id, file){ this.removeClass('blue inverted'); $("#added_files").show(); add_file(id, file); }, onUploadProgress: function(id, percent){ file_progress(id, percent); }, onUploadError: function(id, xhr, status, message){ swal("", message, "error"); }, onFallbackMode: function(){ swal("", "Error.", "error"); }, onFileSizeError: function(file){ swal("",".", "error"); }, onComplete: function(){ location.reload(); }, onUploadSuccess: function(id, data) { var d = $.parseJSON(dat); token = d.data.CSRF_TOKEN; auth = d.data.CSRF_AUTH; if(!data.status){ swal('', data.msg, 'error'); }
`