Skip to content
Merged
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
Don't encode paths passed to the OC.Files.Client
This is handled already in the client. So double encoding breaks things
in some situations.

Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Jan 10, 2018
commit d4f163b2300b5190366f38b51d4e7a80fde6d235
14 changes: 7 additions & 7 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ OC.FileUpload.prototype = {
) {
data.isChunked = true;
chunkFolderPromise = this.uploader.davClient.createDirectory(
'uploads/' + encodeURIComponent(OC.getCurrentUser().uid) + '/' + encodeURIComponent(this.getId())
'uploads/' + OC.getCurrentUser().uid + '/' + this.getId()
);
// TODO: if fails, it means same id already existed, need to retry
} else {
Expand Down Expand Up @@ -272,8 +272,8 @@ OC.FileUpload.prototype = {
}

return this.uploader.davClient.move(
'uploads/' + encodeURIComponent(uid) + '/' + encodeURIComponent(this.getId()) + '/.file',
'files/' + encodeURIComponent(uid) + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
'uploads/' + uid + '/' + this.getId() + '/.file',
'files/' + uid + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
true,
headers
);
Expand All @@ -282,7 +282,7 @@ OC.FileUpload.prototype = {
_deleteChunkFolder: function() {
// delete transfer directory for this upload
this.uploader.davClient.remove(
'uploads/' + encodeURIComponent(OC.getCurrentUser().uid) + '/' + encodeURIComponent(this.getId())
'uploads/' + OC.getCurrentUser().uid + '/' + this.getId()
);
},

Expand Down Expand Up @@ -1166,9 +1166,9 @@ OC.Uploader.prototype = _.extend({
var chunkId = range.split('/')[0].split('-')[0];
data.url = OC.getRootPath() +
'/remote.php/dav/uploads' +
'/' + encodeURIComponent(OC.getCurrentUser().uid) +
'/' + encodeURIComponent(upload.getId()) +
'/' + encodeURIComponent(chunkId);
'/' + OC.getCurrentUser().uid +
'/' + upload.getId() +
'/' + chunkId;
delete data.contentRange;
delete data.headers['Content-Range'];
});
Expand Down