LearnPath - Fix scorm update using bigupload - refs CT#4429

pull/4439/head
Christian 4 years ago
parent 433f2526f1
commit 0901674fb6
  1. 6
      main/inc/lib/javascript/bigupload/inc/bigUpload.php
  2. 2
      main/inc/lib/javascript/bigupload/js/bigUpload.js

@ -63,7 +63,11 @@ class BigUploadResponse
if ($value) {
$this->tempName = $value;
} else {
$this->tempName = mt_rand().'.tmp';
if ('learnpath' === $_REQUEST['origin'] && !empty($_REQUEST['name'])) {
$this->tempName = $_REQUEST['name'];
} else {
$this->tempName = mt_rand().'.tmp';
}
}
}

@ -175,7 +175,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 + (parent.uploadData.key ? '' : '&name=' + parent.uploadData.file.name), true);
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.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {

Loading…
Cancel
Save