0

How to Restrict File Upload Size in PHP Using .Htaccess

Hi Friend’s I trust you are doing great, Today I am thought of one more cool .htaccess trick that is How to Restrict File Upload Size in PHP,Set Maximum Size of Post Data, Set Max Script Execution Time, Using this .htaccess hack you don’t have to change in php.ini file or any server config document, You just need to include taking after lines in your .htaccess records.

html input file size limit, image size validation in javascript, php file upload size limit, php file upload size validation, php restrict file type upload, php upload file types allowed

Restrict File Upload Size in PHP

.htaccess allows you to set file upload values that directly affect your PHP applications. For instance, if you want to impose upload limits in PHP, so that you can prevent your hosting form garbage files. just add below line in your .htaccess file.

Set Maximum Size of Post Data

You can also restrict the maximum post size for uploading files in PHP, doing this add below line in your .htaccess file.

Set Maximum Script Execution Time

If you don’t want scripts to execute forever, you can limit their execution time with the help of the following line.

Leave a Reply

Your email address will not be published. Required fields are marked *