Importing a large file using PHP and jQuery

Importing a large file using PHP and jQuery

I am working on solving a task to import a large CSV file into a database using PHP and MySQL.

I assume once the CSV file is on the server I could use jQuery's ajax capabilities within a loop to send a request to the server to process X amount of lines from the CSV, once done the onComplete part of the ajax call runs and we could update a counter or something similar.  Then the loop continues and sends another request to the server to process another X rows, and so on.

Does anyone have a quick example of how this might be done?