2016-04-20 13:21:01 +00:00
|
|
|
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 = {
|
2016-04-20 13:21:01 +00:00
|
|
|
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){
|
2016-04-20 13:21:01 +00:00
|
|
|
console.log( response );
|
|
|
|
});
|
|
|
|
|
|
|
|
}, false);
|