summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-26 17:35:12 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-26 17:35:12 +0200
commit0249a72caba9f1a4eeaf51f382a74fe61b66c284 (patch)
treebb272c3dbe57b3b2ec0bcb648fb3461668aa20c7
parentebd82ee772ee32dc6fda37c377106f19a30922bf (diff)
downloadnextcloud-server-0249a72caba9f1a4eeaf51f382a74fe61b66c284.tar.gz
nextcloud-server-0249a72caba9f1a4eeaf51f382a74fe61b66c284.zip
fix downloading of files in files app
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files/js/files.js6
-rw-r--r--core/js/js.js5
3 files changed, 7 insertions, 6 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 80e918a455c..fc6c99262ef 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -135,7 +135,7 @@ $(document).ready(function(){
var downloadScope = 'file';
}
FileActions.register(downloadScope,'Download',function(){return OC.imagePath('core','actions/download')},function(filename){
- window.location='ajax/download.php?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val());
+ window.location=OC.filePath('files', 'ajax', 'download.php?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val()));
});
});
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 3ce95f992d0..4637d3cb64d 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -140,7 +140,7 @@ $(document).ready(function() {
var dir=$('#dir').val()||'/';
$('#notification').text(t('files','generating ZIP-file, it may take some time.'));
$('#notification').fadeIn();
- window.location='ajax/download.php?files='+encodeURIComponent(files)+'&dir='+encodeURIComponent(dir);
+ window.location=OC.filePath('files', 'ajax', 'download.php?files='+encodeURIComponent(files)+'&dir='+encodeURIComponent(dir));
return false;
});
@@ -418,7 +418,7 @@ var folderDropOptions={
var target=$(this).text().trim();
var dir=$('#dir').val();
$.ajax({
- url: 'ajax/move.php',
+ url: OC.filePath('files', 'ajax', 'move.php'),
data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(dir)+'/'+encodeURIComponent(target),
complete: function(data){boolOperationFinished(data, function(){
var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename');
@@ -444,7 +444,7 @@ var crumbDropOptions={
return;
}
$.ajax({
- url: 'ajax/move.php',
+ url: OC.filePath('files', 'ajax', 'move.php'),
data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(target),
complete: function(data){boolOperationFinished(data, function(){
FileList.remove(file);
diff --git a/core/js/js.js b/core/js/js.js
index 12303d7dd91..84875ca162f 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -53,12 +53,13 @@ OC={
filePath:function(app,type,file){
var isCore=OC.coreApps.indexOf(app)!=-1;
var link=OC.webroot;
- if((file.substring(file.length-3) == 'php' || file.substring(file.length-3) == 'css') && !isCore){
+ var splitted = file.split('?');
+ if((splitted[0].substring(splitted[0].length-3) == 'php' || splitted[0].substring(splitted[0].length-3) == 'css') && !isCore){
link+='/?app=' + app + '&getfile=';
if(type){
link+=encodeURI(type + '/');
}
- link+= file;
+ link+= file + '?' + splitted[1];
}else if(file.substring(file.length-3) != 'php' && !isCore){
link=OC.appswebroot;
link+='/';