Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only enable web UI chunk upload for non-public page
  • Loading branch information
Vincent Petry committed Jul 17, 2017
commit 6ef4403e3961e56c4ebbdea00d9dd8e44f16ab07
3 changes: 2 additions & 1 deletion apps/files/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
direction: $('#defaultFileSortingDirection').val()
},
config: this._filesConfig,
enableUpload: true
enableUpload: true,
maxChunkSize: 10 * 1024 * 1024 // 10 MB
}
);
this.files.initialize();
Expand Down
5 changes: 4 additions & 1 deletion apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ OC.Uploader.prototype = _.extend({
type: 'PUT',
dropZone: options.dropZone, // restrict dropZone to content div
autoUpload: false,
maxChunkSize: 10 * 1000 * 1000, // 10 MB
sequentialUploads: true,
//singleFileUploads is on by default, so the data.files array will always have length 1
/**
Expand Down Expand Up @@ -1016,6 +1015,10 @@ OC.Uploader.prototype = _.extend({
}
};

if (options.maxChunkSize) {
this.fileUploadParam.maxChunkSize = options.maxChunkSize;
}

// initialize jquery fileupload (blueimp)
var fileupload = this.$uploadEl.fileupload(this.fileUploadParam);

Expand Down
3 changes: 2 additions & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@
this._uploader = new OC.Uploader($uploadEl, {
fileList: this,
filesClient: this.filesClient,
dropZone: $('#content')
dropZone: $('#content'),
maxChunkSize: options.maxChunkSize
});

this.setupUploadEvents(this._uploader);
Expand Down