Cannot upload documents in 1.55.22 Cannot upload documents in 1.55.22
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Cannot upload documents in 1.55.22

Started by drumalone, May 25, 2013, 10:25:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

drumalone

I have installed version 1.5.22 and everything works fine. I can upload pictures in both single and batch methods but cannot upload any document format in single or batch mode. I enter debug mode and get this error...

mySQL error: Incorrect integer value: '' for column 'pwidth' at row 1

I can post the whole error text if that would help.

Any ideas on resolution would be welcome.

Αndré

Please upgrade to cpg1.5.24. If the error still exists there, please follow the upload troubleshooting docs carefully.

drumalone

Thanks, I will upload the latest version.

I have been thru the upload troubleshooting docs but did not find anything talking about just documents as picture uploads work fine. I tried changing the mode but that had no effect.

If the version update does not work I will post a user account for access to check things out.

drumalone

I uploaded v. 1.5.24 and installed. Everything works fine except I still cannot upload any document formats. Pictures upload without problem. I have gone thru the upload troubleshooting doc. and am still no closer to resolving this issue.

Anyone who would take a look here is the info...

The gallery address is www.lightwaveglassstudio.com/coppermine/

User is - test user
password - opendoor

Αndré

Please enable debug mode for everyone. I just tested with a PDF file but got just the generic error message.

drumalone

Debug is enabled for everyone. Sorry I had it on but just for admin.

drumalone

I have noticed that coppermine is uploading documents onto the server even though it looks like the document uploads are failing. The problem seems to be that coppermine cannot find or display them once uploaded. The docs are in albums/userpics along with pictures that do display in the gallery. The docs are in allowable formats.

Αndré

I just tested again to upload a PDF file and got this error message:
QuoteWhile executing query 'INSERT INTO cpg15x_pictures (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position, guest_token) VALUES ('13', 'userpics/10004/', 'DNStunnel_de_-_free_DNS_tunneling_service~0.pdf', '170291', '170291', '', '', '1376925339', '4', 'Test by André', '', '', 'YES', '', '', '', '', '195.126.85.201', '195.126.85.201', '0', '')' in include\picmgmt.inc.php on line 173

mySQL error: Incorrect integer value: '' for column 'pwidth' at row 1

Please check the default value for "pwidth" and "pheight" in your MySQL database. If there's no default value, set it to "0".

drumalone

It appears that the default value for pwidth an pheight are set to "0" already.

Αndré

I just had a closer look at the add_picture function.

This is the query:
Quote$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position, guest_token) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '', '', '', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}', '{$CURRENT_PIC_DATA['guest_token']}')";

The values $CURRENT_PIC_DATA['pwidth'] and $CURRENT_PIC_DATA['pwidth'] are set here:
    $CURRENT_PIC_DATA['pwidth'] = $imagesize[0];
    $CURRENT_PIC_DATA['pheight'] = $imagesize[1];


The values $imagesize[0] and $imagesize[1] are set here:
        $imagesize[0] = $iwidth;
        $imagesize[1] = $iheight;

which both defaults to "0", as you can see here:
Quotefunction add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '', $iwidth = 0, $iheight = 0)

But for some reason your query contains empty values for width and height:
QuoteINSERT INTO cpg15x_pictures (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position, guest_token) VALUES ('13', 'userpics/10004/', 'DNStunnel_de_-_free_DNS_tunneling_service~0.pdf', '170291', '170291', '', '', '1376925339', '4', 'Test by André', '', '', 'YES', '', '', '', '', '195.126.85.201', '195.126.85.201', '0', '')

Please attach the file include/picmgmt.inc.php as zip file to your next reply.