Import Excel - Laravel

0

I'm trying to import a csv into the database, but it's not making a difference

  <script>
$(document).ready(() => {
  $("#import").click((e) => {
    var file = $("#file").prop('files');

    const importFile = file[0];
    const reader = new FileReader();

    reader.onload = (e) => {
      $.ajax({
        type:"POST",
        url: "http://172.19.1.23:4000/quotabox/importExcel",
        data: {
          file: reader.result
        },

        success: (response) => {
          alert("Importado com sucesso");
        }
      });
    }
    reader.readAsText(importFile);
  });
});</script>
    
asked by anonymous 04.06.2018 / 17:48

0 answers