filereader - HTML5 File Reader failed to add multiple files and only adding one file from the list -



filereader - HTML5 File Reader failed to add multiple files and only adding one file from the list -

i want add together 3 files simulteneously.files extension kml,kmz , csv. when select 3 files , click open 3 files in filelist. 1 file getting added on map.if add together individual file i.e. 1 1 works fine. reader onloadend event fired 3 times.but time adds 1 of 3 files.

function handlefileselect(evt) { var files = evt.target.files; // filelist (var = 0; < files.length; i++) { f = files[i]; fileextension = f.name.split('.').pop(); if(fileextension != 'kml' && fileextension !='kmz' && fileextension != 'csv'){ alert('unsupported file type ' + f.type + '(' + fileextension + ')'); return; } var filereaderkmlcsv = new filereader(); filereaderkmlcsv.readastext(f); filereaderkmlcsv.onloadend =loadend; } //- end loop } //handlefileselect

the problem asynchronous code execution in javascript. here answer- asynchronous execution in javascript solution command execution?

html5 filereader

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -