aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2010-06-29 04:00:01 +0200
committerRobin Appelman <icewind1991@gmail.com>2010-06-29 04:00:01 +0200
commit2a5bcbe7219e52dfd66ab54454ea87fa20d3c8df (patch)
treedbdb28b91c51186d53738abbf64a74c80ad705e4 /js
parent0ba0f226276c72b5c7b5ce8fc6e025da347fd178 (diff)
downloadnextcloud-server-2a5bcbe7219e52dfd66ab54454ea87fa20d3c8df.tar.gz
nextcloud-server-2a5bcbe7219e52dfd66ab54454ea87fa20d3c8df.zip
change target directory for uploads when changing folders in web-frontend
Diffstat (limited to 'js')
-rwxr-xr-xjs/filebrowser.js5
-rwxr-xr-xjs/lib_files.js6
2 files changed, 7 insertions, 4 deletions
diff --git a/js/filebrowser.js b/js/filebrowser.js
index 9900ce69902..aae6cdf7720 100755
--- a/js/filebrowser.js
+++ b/js/filebrowser.js
@@ -309,6 +309,9 @@ OC_FILES.browser.show_callback=function(content){
OC_FILES.browser.breadcrumb.show(null,dir);
OC_FILES.browser.files.show(null,content);
}
+ if(OC_FILES.uploadForm){
+ OC_FILES.uploadForm.setAttribute('action','files/upload.php?dir='+dir);
+ }
}
OC_FILES.browser.handleDropOn=function(event,node){
@@ -437,7 +440,7 @@ OC_FILES.browser.showuploader=function(dir,parent,max_upload){
file.name='file';
file.setAttribute('id','fileSelector');
file.setAttribute('type','file');
- file.addEvent('onchange',OC_FILES.upload,[dir,iframeId]);
+ file.addEvent('onchange',OC_FILES.upload,[iframeId]);
OC_FILES.uploadForm.appendChild(document.createTextNode('Upload file: '));
OC_FILES.uploadForm.appendChild(file);
parent.appendChild(OC_FILES.uploadForm);
diff --git a/js/lib_files.js b/js/lib_files.js
index 74a636cc0bc..68c3c611291 100755
--- a/js/lib_files.js
+++ b/js/lib_files.js
@@ -91,7 +91,8 @@ OC_FILES.get=function(dir,file){
window.location='files/api.php?action=get&dir='+encodeURIComponent(dir)+'&file='+encodeURIComponent(file);
}
-OC_FILES.upload=function(dir,iframeId){
+OC_FILES.upload=function(iframeId){
+ var dir=OC_FILES.dir;
var file=new Object;
var fileSelector=document.getElementById('fileSelector');
var max_upload=document.getElementById('max_upload').value;
@@ -110,8 +111,7 @@ OC_FILES.upload=function(dir,iframeId){
if(fileSelector.files && fileSelector.files[0].type){
var mime=fileSelector.files[0].type;
}
- file.dir=dir;
- file.dir=dir;
+ file.dir=OC_FILES.dir;
file.name=name;
file.type='file';
file.size=size;