diff --git a/main/inc/lib/formvalidator/Element/BigUpload.php b/main/inc/lib/formvalidator/Element/BigUpload.php index 52bd121210..219cbef791 100644 --- a/main/inc/lib/formvalidator/Element/BigUpload.php +++ b/main/inc/lib/formvalidator/Element/BigUpload.php @@ -67,6 +67,8 @@ class BigUpload extends HTML_QuickForm_file bigUpload.settings.progressBarColorError = "#da4f49"; //Path to the php script for handling the uploads bigUpload.settings.scriptPath = "'.api_get_path(WEB_LIBRARY_JS_PATH).'bigupload/inc/bigUpload.php"; + //cid Req + bigUpload.settings.cidReq = "'.api_get_cidreq().'"; //Set the origin upload bigUpload.settings.origin = "'.$origin.'"; //The parameters from the upload form diff --git a/main/inc/lib/javascript/bigupload/js/bigUpload.js b/main/inc/lib/javascript/bigupload/js/bigUpload.js index 132dcc3c8c..bd488fef69 100644 --- a/main/inc/lib/javascript/bigupload/js/bigUpload.js +++ b/main/inc/lib/javascript/bigupload/js/bigUpload.js @@ -46,7 +46,10 @@ function bigUpload () { //Max file size allowed //Default: 2GB - 'maxFileSize': 2147483648 + 'maxFileSize': 2147483648, + + //CidReq + 'cidReq': '' }; //Upload specific variables @@ -175,7 +178,7 @@ function bigUpload () { //this.uploadData.key is then populated with the filename to use for subsequent requests //When this method sends a valid filename (i.e. key != 0), the server will just append the data being sent to that file. xhr = new XMLHttpRequest(); - xhr.open("POST", parent.settings.scriptPath + '?action=upload' + '&key=' + parent.uploadData.key + '&origin=' + parent.settings.origin + (parent.uploadData.key ? '' : '&name=' + parent.uploadData.file.name), true); + xhr.open("POST", parent.settings.scriptPath + '?' + parent.settings.cidReq + '&action=upload' + '&key=' + parent.uploadData.key + '&origin=' + parent.settings.origin + (parent.uploadData.key ? '' : '&name=' + parent.uploadData.file.name), true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { @@ -224,7 +227,7 @@ function bigUpload () { this.sendFileData = function() { var data = 'key=' + this.uploadData.key + '&name=' + this.uploadData.file.name + '&type=' + this.uploadData.file.type + '&size=' + this.uploadData.file.size + '&origin=' + parent.settings.origin + '&' + parent.settings.formParams; xhr = new XMLHttpRequest(); - xhr.open("POST", parent.settings.scriptPath + '?action=finish', true); + xhr.open("POST", parent.settings.scriptPath + '?' + parent.settings.cidReq + '&action=finish', true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { @@ -262,7 +265,7 @@ function bigUpload () { this.uploadData.aborted = true; var data = 'key=' + this.uploadData.key; xhr = new XMLHttpRequest(); - xhr.open("POST", this.settings.scriptPath + '?action=abort', true); + xhr.open("POST", this.settings.scriptPath + '?' + this.settings.cidReq + '&action=abort', true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() {