Widget:Multi upload: verschil tussen versies

Uit Dorpsbelang Den Hout
Ga naar:navigatie, zoeken
Regel 30: Regel 30:
 
}
 
}
  
function uploadFiles(evt){
+
function uploadFiles(filename){
 
var files = document.getElementById('files').files;
 
var files = document.getElementById('files').files;
 
var proms = [];  
 
var proms = [];  
 
     for(i = 0; i < files.length; ++i){
 
     for(i = 0; i < files.length; ++i){
 
         file = files[i];
 
         file = files[i];
 +
      if(filename){
 +
        var fileName = filename;
 +
      }else{
 
         var fileName = files[i].name;
 
         var fileName = files[i].name;
 +
        }
 
var prom =  doApiCall(file, fileName);
 
var prom =  doApiCall(file, fileName);
 
         proms.push(prom)
 
         proms.push(prom)
Regel 42: Regel 46:
 
       console.log(values);
 
       console.log(values);
 
           console.log('done');
 
           console.log('done');
        var codeid = document.createElement('input');
+
      //  var codeid = document.createElement('input');
        codeid.setAttribute('type','hidden')
+
      //  codeid.setAttribute('type','hidden')
        codeid.setAttribute('name','uuid')
+
      //  codeid.setAttribute('name','uuid')
        codeid.setAttribute('value', uuid)
+
    //    codeid.setAttribute('value', uuid)
        document.getElementById('files').closest('form').appendChild(codeid)
+
    //    document.getElementById('files').closest('form').appendChild(codeid)
 
         submitRealField()
 
         submitRealField()
 
     });
 
     });

Versie van 18 aug 2020 20:27

Sjabloon:Managed

This is the Widget:Multi upload page. It should be called in the following format:

{{#widget:Multi upload }}