Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#265 Upload image max size display problems

closed-fixed
nabber00
Interface (93)
5
2011-10-30
2011-10-28
Lasse Dittmer
No

In the upload image screens, the displayed file sizes are wrong (negative or way too small), at least in my test deployment(s) (PHP5.2.8/Linux, post_max_size = 8M, upload_max_filesize=2M). Upload works despite of this.

It seems that in upload_img.php, the byte to MB conversion has to be removed or changed somehow to accept MB values... e.g.:

intval(ini_get('post_max_size'))/(1024*1024)
intval(ini_get('upload_max_filesize'))/(1024*1024)

to

intval(ini_get('post_max_size'))
intval(ini_get('upload_max_filesize'))

.. in all relevant sections. This worked for me!

Discussion

  • nabber00
    nabber00
    2011-10-28

    • assigned_to: nobody --> nabber00
    • status: open --> open-accepted
     
  • nabber00
    nabber00
    2011-10-28

    It appears that sphpblog is not handling the possible cases in PHP of these values ending in 'M' or 'K' or 'G' which is the problem. The manual page for the ini_get function explains how to handle this in the example:

    http://us3.php.net/manual/en/function.ini-get.php

     
  • nabber00
    nabber00
    2011-10-30

    • status: open-accepted --> closed-fixed
     
  • nabber00
    nabber00
    2011-10-30

    Fixed in svn r176.