cannot upload any pictures :o( cannot upload any pictures :o(
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

cannot upload any pictures :o(

Started by vlkoun, July 16, 2010, 10:46:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vlkoun

Hi guys.
First I'd like to thank you a LOT for making such a wonderful piece of software. I've been using it since 2008.
My first gallery (1.4xx) runs on: www.vlkoun.cz/foto and is still perfect.
This week I've tried to instal last version of coppermine to www.vlkoun.cz/gallery
Everything seems to be ok, install process didn't show me any error message. I run it on the same sql databese, only the tables have different prefix, so I think it's ok that way.
Now I'm trying to upload a picture but I'm not able to do it :o(
I've tried single and multi picture upload via administration, also ftp upload which I use on older copper version.
It's still not working.
Could you please be so kind to check it for me? Thank you a lot!

www.vlkoun.cz/gallery
test
test

Αndré

QuoteError
Only files with the following extensions are accepted:

Please check your config section which file types you allow ('File settings -> Allowed xyz types').

vlkoun

Quote from: Αndré on July 16, 2010, 11:10:37 AM
Please check your config section which file types you allow ('File settings -> Allowed xyz types').

I have double checked it already:
jpeg/jpg/png/gif
asf/asx/mpg/mpeg/wmv/swf/avi/mov

I didn't make any chanhge in configuration except debug mode for everyone.

Αndré

Maybe something went wrong during the installation. Have you already tried to re-install cpg1.5.6?

vlkoun

Quote from: Αndré on July 16, 2010, 11:44:18 AM
Maybe something went wrong during the installation. Have you already tried to re-install cpg1.5.6?

Yes
Can't you find out from some debug message what the problem is?

Αndré

For some reason your $CONFIG array (or at least that value) isn't populated.

Can you please open db_input.php, find
cpg_die(ERROR, $lang_db_input_php['err_invalid_fext'] . ' ' . $CONFIG['allowed_file_extensions'], __FILE__, __LINE__);
and replace it with
cpg_die(ERROR, $lang_db_input_php['err_invalid_fext'] . ' ' . $CONFIG['allowed_file_extensions'] . print_r($CONFIG, true), __FILE__, __LINE__);

This doesn't solves your issue, but gives us (me) some more information what may has gone wrong.

vlkoun


Αndré

You can undo that change.

As expected, $CONFIG['allowed_file_extensions'] is empty. As far as I can see it is set in this function:
function cpg_get_type($filename,$filter=null)
{
    global $CONFIG;

    static $FILE_TYPES = array();

    if (!$FILE_TYPES) {

        // Map content types to corresponding user parameters
        $content_types_to_vars = array(
            'image'    => 'allowed_img_types',
            'audio'    => 'allowed_snd_types',
            'movie'    => 'allowed_mov_types',
            'document' => 'allowed_doc_types',
        );

        $result = cpg_db_query('SELECT extension, mime, content, player FROM ' . $CONFIG['TABLE_FILETYPES']);

        $CONFIG['allowed_file_extensions'] = '';

        while ( ($row = mysql_fetch_assoc($result)) ) {
            // Only add types that are in both the database and user defined parameter
            if ($CONFIG[$content_types_to_vars[$row['content']]] == 'ALL' || is_int(strpos('/' . $CONFIG[$content_types_to_vars[$row['content']]] . '/', '/' . $row['extension'] . '/'))) {
                $FILE_TYPES[$row['extension']]      = $row;
                $CONFIG['allowed_file_extensions'] .= '/' . $row['extension'];
            }
        }

        $CONFIG['allowed_file_extensions'] = substr($CONFIG['allowed_file_extensions'], 1);

        mysql_free_result($result);
    }

    if (!is_array($filename)) {
        $filename = explode('.', $filename);
    }

    $EOA            = count($filename) - 1;
    $filename[$EOA] = strtolower($filename[$EOA]);

    if (!is_null($filter) && array_key_exists($filename[$EOA], $FILE_TYPES) && ($FILE_TYPES[$filename[$EOA]]['content'] == $filter)) {
        return $FILE_TYPES[$filename[$EOA]];
    } elseif (is_null($filter) && array_key_exists($filename[$EOA], $FILE_TYPES)) {
        return $FILE_TYPES[$filename[$EOA]];
    } else {
        return null;
    }
}


Are you able to debug this yourself? I never had a deeper look at this function and am currently short of time. But it cannot hurt to output all variables and array of that function.

vlkoun

Unfortunatelly I'm not able to fix this myself :(
I really don't understand why it happend. It doesn't respect my setting in configuration menu.
Could you send me a copy of good "functions.inc.php" file so I can fix it myself?
Thank you

Αndré

Can you please extract and upload the attached file to the gallery/ folder of your server?

vlkoun

Quote from: Αndré on July 16, 2010, 02:19:39 PM
Can you please extract and upload the attached file to the gallery/ folder of your server?

done

Αndré

Please check if the filetypes table exists in your database.

vlkoun

Quote from: Αndré on July 16, 2010, 05:09:27 PM
Please check if the filetypes table exists in your database.

Yes it does.
You can check attached pictures.
First is a screenshot from my DB administration, second is a screenshot from filetype editor plugin which I've tried today to fix my problem.
I don't know how to save changes when I check some of the listed options (for example, jpg, jpeg, gif).
There is no such button like SAVE. Only: delete selected filetype, add new filetype

Joachim Müller

Temporarily switch to English before taking a screenshot that you plan to post here. Afterwards, change the language back. This can be accomplished easily both in Coppermine as well as phpMyAdmin. None of the devs and supporters speaks Czech.
You haven't configured http://www.vlkoun.cz/gallery/, as the gallery name still says that it's "Your gallery name here", which is something you can't get away with during initial configuration. I guess that you haven't gone through Coppermine's config and haven't set it up properly.

vlkoun

Ok with czech lang. I'll do it next time.
But  I'm affraid you're wrong about initial configuration.
I did all the steps and there was no name change at all :(
Maybe in old install? I used a new one. I'll try the old one.
And what about that test.php you wanted me to to copy to my gallery? Any ideas from that?
I'm sad that I have to bother you guys, maybe I'll switch to 1.4x version instead? It was working for me fine.

Αndré

The test.php should output more just an empty array. Seems that there's an encoding issue with your filetypes table. Can you take a screen shot of the content of that table with phpMyAdmin? Or even give me access to your database via phpMyAdmin?

vlkoun

Sure, Can I give you my pass via PM?

Αndré

I sent your my contact information via PM, as regular users aren't allowed to use PMs.

vlkoun


Αndré