You can can set file size like this:
$UserPhoto->setVar('sizeLimit', '5242880'); (doesn't work)
Otherwise it gets the file size from the php setting for max file upload size. Setting the above and the php variable made no difference. It was always 8mb. Default on the server was 32mb.
if (settings.sizeLimit) data.sizeLimit = 20971520;
I haven't had a chance to work through, but at some point the variable is not getting set or passed through. I needed a quick solution.
Changing the php.ini and placing in root or sapphire folder had no effect at all.