NxTIC/view/js/input.js

18 lines
395 B
JavaScript
Raw Normal View History

var fileInput = document.querySelector('input[type=file]');
fileInput.addEventListener('change', function(e){
/* (1) On rédige la requête */
2016-04-20 13:46:19 +00:00
var uploadRequest = {
path: 'upload/call_log',
file: fileInput.files[0]
};
/* (2) On effectue l'upload (import) */
2016-04-20 13:46:19 +00:00
api.send(uploadRequest, function(response){
console.log( response );
});
}, false);