I have this code:
Html:
<input type="file" name="filename" id="filename">
jQuery:
$("#filename").change(function(e) {
var url = $("input#filename").val();
 $.ajax({            
        type: "POST",
        url: "/importArticleCsv",
        dataType: "json",
        data: "url="+ url,
        success: function(response)
        {
            alert("succes");
        }
    });
    return false;
});
php:
public function importArticleCsv(){      
    $url = $this->input->post('url');
        $csv_file = CSV_PATH . $url; // Name of your CSV file
$csvfile = fopen($csv_file, 'r');
$theData = fgets($csvfile);
$i = 0;
while (!feof($csvfile)) {
    $csv_data[] = fgets($csvfile, 1024);
    $csv_array = explode(",", $csv_data[$i]);
    $insert_csv = array();
    $insert_csv['ID'] = $csv_array[0];
    $insert_csv['name'] = $csv_array[1];
    $insert_csv['email'] = $csv_array[2];
$i++;
}
fclose($csvfile);
}
How can i upload the csv file, en send it to php so php can add everything in a array? I have all this code, and it goes to the right function but than it does nothing? how is this possible?
 
     
    