• Resolved romerocw

    (@romerocw)


    In the photo gallery component I’m seeing a max size pic upload of 0 bytes. I have the variable set at 2048 but it is being ignored. Where is the 0 value coming from?

    I have no issues uploading via WP to my site and I have no upload issues w/ php itself.

    Because of the 0 bytes setting I can’t upload w/in User Community gallery.

    I imagine I’ve simply overlooked the obvious. A little help appreciated.

    TIA.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Check on your php.ini that this settings:

    file_uploads = On
    upload_max_size
    post_max_size

    This is what the plugin reads to get the max system upload size.

    Thread Starter romerocw

    (@romerocw)

    Hi Txanny,

    Yes, all my php upload variables are set correctly. I can upload w/out any problems via WP and my other non-WP scripts.

    It seems that the variable is being ignored. The default install of User Community assigns a value of:

    Max. Upload Size: 2048 kb
    (Maximum size for each image file an user can upload in Kb. System max is: 0 bytes)

    Regardless of what I change “Max. Upload Size” to from within User Community the variable is ignored. If I change it to 4096 it will record the variable correctly in the form field but it is still ignored by User Community and the footnote still displays System max size is: 0 bytes.

    Like I wrote above. I can upload photos with my base WordPress install as well as with NGG Gallery plugin without any problems.

    Thanks,

    -Charlie

    Thread Starter romerocw

    (@romerocw)

    I finally had time to track down this bug.

    Here’s the issue…

    If a user compiles php w/out –enable-memory-limit then the php.ini directive for memory_limit is left out at run time and therefore ignored by php scripts.

    In filesystem.php the script is asking php.ini for the value of memory_limit. Because it isn’t compiled in it returns a value of ‘0’. This is then interpreted by filesystem.php as the lowest value of upload_max_filesize and post_max_size and is chosen as the maximum accepted upload size.

    In my opinion memory_limit should be eliminated from the filesystem.php script. Or if it is left in then the value returned should be overlooked if 0 is the returned value.

    In my case I changed this line:
    // $mem = ak_return_bytes(ini_get(‘memory_limit’));

    to:
    $mem = ‘134217728’;

    and set it at 256MB and then I don’t have to worry about it anymore. ??

    Thanks for the great plugin.

    -Charlie

    Thanks for your time and your solution. You’re right, I think the best idea is to overwrite the system returned limit by the one set on the settings page.

    Probably the best idea is to change to this code in components/gallery.php

    public function maxUpload()
    	{
    		$max = 1024 * (int) $this->settings['max_size'];
    		return $max;
    	}
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: User Community] System max is: 0 bytes for pic uploads’ is closed to new replies.