]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix downloading of files in files app
authorGeorg Ehrke <dev@georgswebsite.de>
Thu, 26 Apr 2012 15:35:12 +0000 (17:35 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Thu, 26 Apr 2012 15:35:12 +0000 (17:35 +0200)
apps/files/js/fileactions.js
apps/files/js/files.js
core/js/js.js

index 80e918a455c74d000e9c9a21637a44cc3c6659a4..fc6c99262efa476fd1663985059823f369e280a7 100644 (file)
@@ -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()));
        });
 });
 
index 3ce95f992d0b3835cd52a7dd2bb713f7ecd7811c..4637d3cb64d9311d543ed3603cf9414760f31616 100644 (file)
@@ -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);
index 12303d7dd91de1a7a3eafa3a18cdd7cc9b1015f5..84875ca162f69276d10ffa0dc876259ef36db5e5 100644 (file)
@@ -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+='/';