Page is loading after submit before the file is processed

It sounds like you’re running into the server’s timeout setting (usually between 30 and 60 seconds). Once you hit that point, the page stops loading and returns as much as has been processed. In your case, I would try loading portions of the csv as pages just like paging through posts in WordPress. If you need to load the full csv, try loading it in dynamically with AJAX requests until the fill csv is loaded.

If you’re doing any processing on the csv, I would do these in chunks as well to prevent hitting this timeout. You could do this with scheduled tasks, AJAX requests, or even via the command line, if that’s a possibility.