Multisite Error: file too large – $retval['max_file_size'] = '0kb';
-
WP 3.7.1
NextGEN 2.0.40Troubleshooting an issue that started occuring on our multisite install. Whenever attempting to upload images to a gallery, a JS alert pops up stating “Error: file too large”. Looking around in the plugin code I discovered that the wp_max_upload_size() function is returning 0, even though Network Settings > “Max upload filesize” is set to 200000kb. No matter what I set it to, it doesn’t reflect in NextGEN. Media Library uploads work fine, however.
Here is my workaround…
File:
/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.phpLine 32:
$retval['max_file_size'] = strval(round( (int) wp_max_upload_size() / 1024 )).'kb';
For my purposes, I changed this line to override “0kb” with “1500kb” as follows:
$retval['max_file_size'] = ( wp_max_upload_size() ? strval(round( (int) wp_max_upload_size() / 1024 )).'kb' : '1500kb' );
Any ideas why wp_max_upload_size() is returning 0?
-Paul
- The topic ‘Multisite Error: file too large – $retval['max_file_size'] = '0kb';’ is closed to new replies.