How can I reduce file upload size?

The current file upload size limit is 128MB. I want to reduce this to 1MB.
I do not have access to php.ini file. I do have access to .htaccess and I could use this solution.

But why isn’t there a method for doing this in the functions.php file?

** UPDATE **

So this, over at Stackoverflow, basically says why:

Those settings are not going to have any effect when set via ini_set

The reason is that PHP needs those values before your script is even executed. When an upload occurs, the target script is executed when the upload is complete, so PHP needs to know the maximum sizes beforehand.

Set them in php.ini, your virtual host config, or in a .htaccess file. A typical .htaccess file would look like this

php_value post_max_size 30M
php_value upload_max_filesize 30M

So the question remains; Is there a way to set max upload size in WP functions.php?

Solutions Collecting From Web of "How can I reduce file upload size?"

Absolutely, you can simply hook into upload_size_limit and set a maximum filesize:

// Change the upload size to 1MB
add_filter( 'upload_size_limit', 'wpse_163236_change_upload_size' ); 
function wpse_163236_change_upload_size()
    return 1000 * 1024;

You can restrict the file size via the wp_handle_upload_prefilter, where

The single parameter, $file, represent a single element of the $_FILES array.

The code below is just exemplary, but you’ll get the point.

function wpse163236_restrict_upload_file_size( $file ){
    $file_size  = $file[ 'size' ];
    $size_limit = '1024000';
    if ( $size_limit < $file_size ) {
        $file[ 'error' ] = 'File Size Over: ' . $size_limit;
    return $file;

No there isn’t a way to reduce the file size without access to php.ini or .htaccess for the reason your quote explains very well.

The best you can do without access to php.ini is to ignore the file as lalocin’s answer shows