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 <roeland@famdouma.nl>
This commit is contained in:
parent
e5cc8ebe7a
commit
d4f163b230
|
@ -235,7 +235,7 @@ OC.FileUpload.prototype = {
|
||||||
) {
|
) {
|
||||||
data.isChunked = true;
|
data.isChunked = true;
|
||||||
chunkFolderPromise = this.uploader.davClient.createDirectory(
|
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
|
// TODO: if fails, it means same id already existed, need to retry
|
||||||
} else {
|
} else {
|
||||||
|
@ -272,8 +272,8 @@ OC.FileUpload.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.uploader.davClient.move(
|
return this.uploader.davClient.move(
|
||||||
'uploads/' + encodeURIComponent(uid) + '/' + encodeURIComponent(this.getId()) + '/.file',
|
'uploads/' + uid + '/' + this.getId() + '/.file',
|
||||||
'files/' + encodeURIComponent(uid) + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
|
'files/' + uid + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
|
||||||
true,
|
true,
|
||||||
headers
|
headers
|
||||||
);
|
);
|
||||||
|
@ -282,7 +282,7 @@ OC.FileUpload.prototype = {
|
||||||
_deleteChunkFolder: function() {
|
_deleteChunkFolder: function() {
|
||||||
// delete transfer directory for this upload
|
// delete transfer directory for this upload
|
||||||
this.uploader.davClient.remove(
|
this.uploader.davClient.remove(
|
||||||
'uploads/' + encodeURIComponent(OC.getCurrentUser().uid) + '/' + encodeURIComponent(this.getId())
|
'uploads/' + OC.getCurrentUser().uid + '/' + this.getId()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1166,9 +1166,9 @@ OC.Uploader.prototype = _.extend({
|
||||||
var chunkId = range.split('/')[0].split('-')[0];
|
var chunkId = range.split('/')[0].split('-')[0];
|
||||||
data.url = OC.getRootPath() +
|
data.url = OC.getRootPath() +
|
||||||
'/remote.php/dav/uploads' +
|
'/remote.php/dav/uploads' +
|
||||||
'/' + encodeURIComponent(OC.getCurrentUser().uid) +
|
'/' + OC.getCurrentUser().uid +
|
||||||
'/' + encodeURIComponent(upload.getId()) +
|
'/' + upload.getId() +
|
||||||
'/' + encodeURIComponent(chunkId);
|
'/' + chunkId;
|
||||||
delete data.contentRange;
|
delete data.contentRange;
|
||||||
delete data.headers['Content-Range'];
|
delete data.headers['Content-Range'];
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue