Browse Source

[app:files] Use current directory for hashing.

This fixes collisions that were causing uploads to break in a very
terrible way.

Kudos to @kesselb for finding the problematic place and to
@hottwister for the proposed solution.

Fixes #10527.
pull/14674/head
Evilham 7 years ago
parent
commit
de648f6a3e
  1. 7
      apps/files/js/file-upload.js

7
apps/files/js/file-upload.js

@ -34,12 +34,11 @@
OC.FileUpload = function(uploader, data) {
this.uploader = uploader;
this.data = data;
var path = '';
var basePath = '';
if (this.uploader.fileList) {
path = OC.joinPaths(this.uploader.fileList.getCurrentDirectory(), this.getFile().name);
} else {
path = this.getFile().name;
basePath = this.uploader.fileList.getCurrentDirectory();
}
var path = OC.joinPaths(basePath, this.getFile().relativePath || '', this.getFile().name);
this.id = 'web-file-upload-' + md5(path) + '-' + (new Date()).getTime();
};
OC.FileUpload.CONFLICT_MODE_DETECT = 0;

Loading…
Cancel
Save