code: function uploadFileList(files){
  
  		// FileList
  		if(!("FileList" in window) || (files instanceof File) || (files instanceof Blob)){
  			// Make an Array
  			files = [files];
  		}
  
  
  		var max = 20, len = files.length;
  		if(len>max){
  			var bool = confirm("You man only upload "+max+" files at a time");
  			if(!bool){
  				return;
  			}
  			len = max;
  		}
  
  		// Loop through the array and place the items on the page
  		for(var i=0;i<len;i++){
  			createRef(files[i]);
  		}
  	}
docs: Upload file list Take all the photos in the FileList and create items with them