forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: altenae on November 10, 2011, 09:26:00 pm

Title: Wrong error upload filesize > filesize in config
Post by: altenae on November 10, 2011, 09:26:00 pm
This issue still excists on all of my three coppermine galleries (1.5.16)

http://forum.coppermine-gallery.net/index.php/topic,61711.0.html

The only thing wrong is the filesize.
In the config 512kb
If I upload 600 kb I would expect to get this error:

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10)) {

        @unlink($uploaded_pic);
        cpg_die(ERROR, sprintf($lang_db_input_php['err_imgsize_too_large'], $CONFIG['max_upl_size']), __FILE__, __LINE__);
Title: Re: Wrong error upload filesize > filesize in config
Post by: Αndré on November 14, 2011, 05:47:46 pm
I assume this is exactly the same issue like here (http://forum.coppermine-gallery.net/index.php/topic,73722.msg355072.html#msg355072), so please try that (http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.5.x/upload.php?r1=8273&r2=8272&pathrev=8273) fix and report if it works as expected.
Title: Re: Wrong error upload filesize > filesize in config
Post by: altenae on November 14, 2011, 07:16:58 pm
Changed in the db_input.php

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10))

into

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] * 1024))

The result is the same.
I have put a print statement and it looks like it never comes to this code.
Strange, because the only thing wrong is the filesize which is larger than I have configured in the config.

Edward
Title: Re: Wrong error upload filesize > filesize in config
Post by: Αndré on November 15, 2011, 11:54:50 am
Don't forget to add
Code: [Select]
die();after your print statement. I'll also perform some tests asap (which might take some time these days).
Title: Re: Wrong error upload filesize > filesize in config
Post by: Αndré on November 15, 2011, 05:16:21 pm
Good news: http://forum.coppermine-gallery.net/index.php/topic,61711.msg355945.html#msg355945
Title: Re: Wrong error upload filesize > filesize in config
Post by: altenae on November 15, 2011, 06:17:57 pm
Hi Andre,

The line you are referring to is present in the upload.php ?

If so , I can.t find any line with "name="MAX_FILE_SIZE" in it...

Edward
Title: Re: Wrong error upload filesize > filesize in config
Post by: Αndré on November 16, 2011, 10:47:02 am
It's that line in upload.php:
Code: [Select]
array('MAX_FILE_SIZE', $max_file_size, 4),
Title: Re: Wrong error upload filesize > filesize in config
Post by: altenae on November 16, 2011, 03:29:49 pm
Yep,

Works correct now.