Async uploads should help catching timeout errors
This commit is contained in:
@@ -160,13 +160,15 @@ var UploadWorker = /** @class */ (function () {
|
|||||||
formData.append("name", file.name);
|
formData.append("name", file.name);
|
||||||
var that = this; // jquery changes the definiton of "this"
|
var that = this; // jquery changes the definiton of "this"
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
url: "/api/file",
|
url: "/api/file",
|
||||||
data: formData,
|
data: formData,
|
||||||
|
timeout: 300000,
|
||||||
cache: false,
|
cache: false,
|
||||||
|
async: true,
|
||||||
crossDomain: false,
|
crossDomain: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
processData: false,
|
processData: false,
|
||||||
type: 'POST',
|
|
||||||
xhr: function () {
|
xhr: function () {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.upload.addEventListener("progress", function (evt) {
|
xhr.upload.addEventListener("progress", function (evt) {
|
||||||
|
@@ -72,13 +72,15 @@ class UploadWorker {
|
|||||||
var that = this // jquery changes the definiton of "this"
|
var that = this // jquery changes the definiton of "this"
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
url: "/api/file",
|
url: "/api/file",
|
||||||
data: formData,
|
data: formData,
|
||||||
|
timeout: 300000, // 5 minutes
|
||||||
cache: false,
|
cache: false,
|
||||||
|
async: true,
|
||||||
crossDomain: false,
|
crossDomain: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
processData: false,
|
processData: false,
|
||||||
type: 'POST',
|
|
||||||
xhr: function () {
|
xhr: function () {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.upload.addEventListener("progress", function (evt) {
|
xhr.upload.addEventListener("progress", function (evt) {
|
||||||
|
Reference in New Issue
Block a user