The user of the other question mentions
.user.ini file, which is the equivalent for PHP of what
.htaccess is for Apache, namely a local configuration file.
You are looking for limiting the maximum size of a
POST request, which is the standard type of requests for sending forms/uploading stuff. The php setting you are looking for, is
.user.ini in the root of your domain (the one with the
wp-config.php file) and put just this line inside:
post_max_size = 30M
This will make the php script reject any submission which is larger than 30M, also counting text fields and everything. However depending on your upload logic (ajax? direct post?) you have to handle the "upload too large" case. If you are doing a "simple" form submission you will get a
413 Request entity too large HTTP error. In this case you should consider doing a little apache+htaccess magic and create some customized error pages. If you upload through an ajax submission then you have just to put a simple check in the ajax callback.
If you are using nginx and/or php-fpm above instructions vary slightly, but it's pretty easy to find the nginx-equivalent settings.