Parsing local CSV file using Papaparse in Cordova iOS
<p>I'm using <code>Papaparse</code> and I'm trying to parse a CSV file which is saved in a folder within <code>www</code>. </p>

<p>It works well with <code>android</code> and <code>browser</code> platform. </p>

<p>However, when it comes to <code>iOS</code>, it returns the error callback.</p>

<p>When I output the error, it returns <code>undefined</code>.</p>

<p>I also checked whether the file path for iOS is correct, and the file does exist.</p>

<p>I have already tried setting the file path as <code>"folder/myfile.csv"</code> but since it resulted in an error, I tried to get its full path using the file plugin.</p>

<p>Anyone else encountered the same problem and have a workaround?</p>

<p>This is my code.</p>

<pre><code>var getOldData = function() {
    var dir = "folder/myfile.csv",
        file = null;

    file = (isiOS) ? cordova.file.applicationDirectory + "www/" + dir : dir;

    Papa.parse(file, {
        download: true,
        error: function(err, file) {
            console.log("&gt;&gt;&gt;&gt; PAPA PARSE ERROR");
            console.log("&gt;&gt;&gt;&gt;" + err); // this returns undefined
            console.log("&gt;&gt;&gt;&gt;" + file); // this returns undefined as well
        },
        complete: function(results) {
            console.log("&gt;&gt;&gt;&gt; PAPA RESULTS");
            console.log(results);
        },
        header: true,
        dynamicTyping: true
    });
};
</code></pre>

<p>Thanks in advance!</p>