using upload class

using upload class

montoyammontoyam Posts: 568Questions: 136Answers: 5

I have used papa parse to read a csv file. However, I have a file that I need to parse manually because it is not in a csv format.

I see that papa parse 'hijacks' the ajax call to do its work, but I am not understanding how to get to the content of the file. I am looking at the object in the console, but not able to find/reference the actual data

        var uploadEditor = new $.fn.dataTable.Editor({
            fields: [{
                label: 'CSV file:',
                name: 'csv',
                type: 'upload',
                ajax: function (files) {
                    // Ajax override of the upload so we can handle the file locally. Here we use Papa
                    // to parse the CSV.
                    console.log(files[0]);
                }
            }]
        });

        $("#importFile").on("click", function () {
            uploadEditor.create({
                title: 'Language Line Import'
            });
        });

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.