Merge pull request #58 from kageurufu/fix-encoded-filenames

Use encodeURI instead of encodeURIComponent for paths+filename
This commit is contained in:
meteyou 2020-09-06 22:53:26 +02:00 committed by GitHub
commit c971e80074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,7 +403,7 @@
let filename = (this.currentPath+"/"+this.contextMenu.item.filename); let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
let link = document.createElement("a"); let link = document.createElement("a");
link.download = name; link.download = name;
link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + encodeURIComponent(filename); link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + encodeURI(filename);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
@ -435,7 +435,7 @@
removeFile() { removeFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename); let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
axios.delete( axios.delete(
'http://'+ this.hostname + ':' + this.port +'/server/files/'+encodeURIComponent(filename) 'http://'+ this.hostname + ':' + this.port +'/server/files/' + encodeURI(filename)
).then((result) => { ).then((result) => {
this.$toast.success(result.data.result+" successfully deleted."); this.$toast.success(result.data.result+" successfully deleted.");
}).catch(() => { }).catch(() => {