Created
February 27, 2018 12:26
-
-
Save noherczeg/334a017249b7aeb447daed3e05063f16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('change', '#clientupload', function () { | |
var x = document.getElementById("clientupload"); | |
if ('files' in x) { | |
if (x.files.length > 0) { | |
//only one file accepted | |
for (var i = 0; i < 1; i++) { | |
var myFile = x.files[0]; | |
var reader = new FileReader(); | |
reader.readAsText(myFile); | |
reader.onload = function () { | |
window.sessionStorage.setItem(STORAGE_KEY, reader.result); | |
$('#clientId').val(null); | |
$('#reset-file').show(); | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment