Open Bug 576524 Opened 14 years ago Updated 12 years ago

Could not upload images


(Testopia :: General, defect)

Windows XP
Not set


(Not tracked)



(Reporter: andreas.hoehmann, Assigned: gregaryh)



(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)
Build Identifier: 

File upload result in 

<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR:  invalid byte sequence for encoding &quot;UTF8&quot;: 0xff
HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by &quot;client_encoding&quot;. [for Statement &quot;INSERT INTO test_attachment_data (attachment_id, contents) VALUES(?,?)&quot;] at Bugzilla/Testopia/ line 183
	Bugzilla::Testopia::Attachment::create('Bugzilla::Testopia::Attachment', 'HASH(0x3241ac0)') called at /var/www/domains/ line 152
For help, please send mail to the webmaster (<a href="mailto:[no address given]">[no address given]</a>), giving this error message 
and the time and date of the error.


Reproducible: Always

Steps to Reproduce:
1. open testcase
2. switch tab "attachments"
3. try to upload a file
I have fixed the database statement below line 182 in the to allow testopia to insert the attachment data as binary data into the table.

This is made like the original Bugzilla code with a prepared statment.

This fixed should be applied to ALL current Testopia versions.
Could you please attach a patch instead? It would be much easier to see what has changed rather than uploading the entire file. You can create a patch by using the diff -u command. You might also want to check out the latest version from CVS or BZR as any changes that might have been made since the version you are working with could be overwritten when the patch is applied. You would also be able to use cvs or bzr diff to make the patch in that case. Instructions can be found at
This is the requested patch. I have create the patch between trunk ( and the file from the 2.2 Version (

The relevant changes are between line 99 and 111 in the patch file! The rest comes from differences between 2.2 and trunk.

Hope you can include the patch ... but be aware! I'am not a good or pure perl programmer ... this is just a quick fix (which works for us for sure) but should be reviewed.
You need to log in before you can comment on or make changes to this bug.