I would like to upload a large file, not more than 300mb on size. I will upload the file into the database. I have added the upload button in my form. My issue is how can I make this possible considering there is a limit to upload files. I have successfully uploaded other files which are less than 2mb and it have successfully uploaded.kindly help o how to go about on this, I am using laravel 8
Asked
Active
Viewed 2,406 times
0
-
Increase your `upload_max_filesize` and `post_max_size` in `php.ini`: https://stackoverflow.com/a/2184541/3965631. Also, don't store files in your database. Upload to a server (local filesystem or something like AWS S3), and store the file location/reference in the database. – Tim Lewis Mar 01 '21 at 15:14
-
Note that the upload time increases with larger files. This can cause timeouts for users with low bandwidth. You may have to adjust the `max_execution_time` in `php.ini` and the timeout of the web server. If you have no influence on these parameters, the upload may be split up. – slp Mar 02 '21 at 05:45
1 Answers
1
I am using xampp | windows 10 | Laravel 8
There are several methods to achieve this, you can pick as per your requirement.
Xampp Apache Configuration : XXX:\xampp\php\php.ini
Updating in .htaccess file :-
<IfModule php7_module> php_flag display_errors On php_value max_execution_time 999 php_value max_input_time 999 php_value max_input_vars 1000 php_value memory_limit 9999M php_value post_max_size 9999M php_value upload_max_filesize 9999M </IfModule>
Creating php.ini in public folder so that we can override main configuration of php.
display_errors = On max_execution_time = 999 max_input_time = 999 max_input_vars = 1000 memory_limit = 9999M post_max_size = 9999M session.save_path = "/var/cpanel/php/sessions/ea-php73" upload_max_filesize = 9999M zlib.output_compression = Off
After making changes make sure you always restart your server to see the effect of changes, Plus you can always view the changes by running
dd(phpinfo()); OR <?php echo phpinfo(); ?>

Vipertecpro
- 3,056
- 2
- 24
- 43