summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorRobin <robin@Amaya.(none)>2010-03-26 19:04:35 +0100
committerRobin <robin@Amaya.(none)>2010-03-26 19:04:35 +0100
commit5cb7524d5c99c1869d0de7e6cf4fb6606d88712f (patch)
tree68ac2de2e24c4f27566c70a1a760aa7ec5191d4a /js
parentba9c95621bccddc8c83689906643a080e1671f22 (diff)
downloadnextcloud-server-5cb7524d5c99c1869d0de7e6cf4fb6606d88712f.tar.gz
nextcloud-server-5cb7524d5c99c1869d0de7e6cf4fb6606d88712f.zip
added MAX_FILE_SIZE field to upload form
Diffstat (limited to 'js')
-rw-r--r--js/lib_files.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/lib_files.js b/js/lib_files.js
index 8d1039a3b0d..3affcf41a3b 100644
--- a/js/lib_files.js
+++ b/js/lib_files.js
@@ -26,6 +26,8 @@ OC_FILES.getdirectorycontent_parse=function(req){
var files=new Array();
var response=req.responseXML;
if(response){
+ var dir=response.getElementsByTagName('dir').item(0);
+ files['max_upload']=dir.getAttribute('max_upload');
var fileElements=response.getElementsByTagName('file');
if(fileElements.length>0){
for(index in fileElements){
@@ -205,11 +207,11 @@ OC_FILES.showbrowser_callback=function(content){
tr.appendChild(td);
td.className='upload';
td.setAttribute('colspan','5');
- this.showuploader(dir,td);
+ this.showuploader(dir,td,content['max_upload']);
contentNode.appendChild(files);
}
-OC_FILES.showuploader=function(dir,parent){
+OC_FILES.showuploader=function(dir,parent,max_upload){
this.uploadForm=document.createElement('form');
this.uploadForm.setAttribute('target','uploadIFrame');
this.uploadForm.setAttribute('action','files/upload.php?dir='+dir);
@@ -219,6 +221,11 @@ OC_FILES.showuploader=function(dir,parent){
this.uploadIFrame.className='hidden';
this.uploadIFrame.name='uploadIFrame';
parent.appendChild(this.uploadIFrame);
+ var input=document.createElement('input');
+ input.setAttribute('type','hidden');
+ input.setAttribute('name','MAX_FILE_SIZE');
+ input.setAttribute('value',max_upload);
+ this.uploadForm.appendChild(input);
var file=document.createElement('input');
file.name='file';
file.setAttribute('type','file');