forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: vlkoun on July 16, 2010, 10:46:39 am

Title: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 10:46:39 am
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
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 16, 2010, 11:10:37 am
Quote
Error
Only files with the following extensions are accepted:

Please check your config section which file types you allow ('File settings -> Allowed xyz types').
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 11:35:24 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.
Title: Re: cannot upload any pictures :o(
Post by: Α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?
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 11:48:21 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?
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 16, 2010, 12:07:03 pm
For some reason your $CONFIG array (or at least that value) isn't populated.

Can you please open db_input.php, find
Code: [Select]
cpg_die(ERROR, $lang_db_input_php['err_invalid_fext'] . ' ' . $CONFIG['allowed_file_extensions'], __FILE__, __LINE__);and replace it with
Code: [Select]
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.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 12:15:01 pm
Done
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 16, 2010, 12:49:32 pm
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:
Code: [Select]
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.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 01:28:55 pm
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
Title: Re: cannot upload any pictures :o(
Post by: Α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?
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 02:50:17 pm
Can you please extract and upload the attached file to the gallery/ folder of your server?

done
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 16, 2010, 05:09:27 pm
Please check if the filetypes table exists in your database.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 16, 2010, 08:00:32 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
Title: Re: cannot upload any pictures :o(
Post by: Joachim Müller on July 17, 2010, 07:44:55 am
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.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 10:07:53 am
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.
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 17, 2010, 10:27:15 am
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?
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 10:29:22 am
Sure, Can I give you my pass via PM?
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 17, 2010, 10:55:48 am
I sent your my contact information via PM, as regular users aren't allowed to use PMs.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 12:22:05 pm
Did you get my email?
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 17, 2010, 01:49:11 pm
Yes. I'm not 24/7 on my PC ;)
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 01:57:55 pm
I know that :)
It was just a chcek if it went through spam filters :)
Title: Re: cannot upload any pictures :o(
Post by: Αndré on July 17, 2010, 02:09:39 pm
Please have a look at the attached screen shot. There are a lot of '\0's in each field. I recognized that the data type of your columns is 'binary' instead of 'char'. I already deleted the table and re-created it and also tried to change the type of that columns. It doesn't work. Please contact your hosting provider to fix that issue.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 02:24:20 pm
Thank you
I will forward your answe to my web page provider.
I hope he will be able to help me.
Title: Re: cannot upload any pictures :o(
Post by: vlkoun on July 17, 2010, 09:12:58 pm
Andre, I've solved that problem.

You were right, there was an issue with my SQL database.
I have another website with more expensive "package" of function and I can create more databases there.
So I run cpg gallery on vlkoun.cz but SQL runs somewhere else and it is finally working now!

Thank you, you can close that post now  :)