How to properly handle large file uploads with Laravel 9 without timing out?
I'm stuck on something that should probably be simple. I keep running into I tried several approaches but none seem to work..... This might be a silly question, but I'm currently working on a Laravel 9 application where users need to upload large CSV files (up to 100MB)... However, I keep running into a timeout scenario during the upload process. The behavior message I receive is: `The upload file exceeds the upload_max_filesize directive in php.ini`. I've already increased the `upload_max_filesize` and `post_max_size` in my `php.ini` file to 200MB, and I'm also setting the `max_execution_time` to 300 seconds. Despite these changes, the upload still fails intermittently, especially when multiple users are uploading simultaneously. Here's what my `php.ini` settings look like: ```ini upload_max_filesize = 200M post_max_size = 200M max_execution_time = 300 max_input_time = 300 ``` In my Laravel controller, I have set up the file upload as follows: ```php public function upload(Request $request) { $request->validate([ 'file' => 'required|file|mimes:csv,txt|max:200000', // max file size in kilobytes ]); $path = $request->file('file')->store('uploads'); return response()->json(['path' => $path], 200); } ``` I've also tried adjusting the `timeout` settings in my `RouteServiceProvider`, but that doesn't seem to help either. I would like to understand the best practices for handling large file uploads in Laravel. Are there specific configurations or techniques that can help prevent these timeout issues? Is there a way to provide users with feedback on their upload progress? Any suggestions would be greatly appreciated! What am I doing wrong? I'm working on a CLI tool that needs to handle this. Thanks for your help in advance! I'd be grateful for any help.