View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012837 | mantisbt | db postgresql | public | 2011-03-04 09:39 | 2016-07-19 10:29 |
Reporter | dforce | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | Microsoft | OS | Windows | OS Version | 2008 R2 |
Product Version | 1.2.4 | ||||
Target Version | 1.3.0-beta.1 | Fixed in Version | 1.3.0-beta.1 | ||
Summary | 0012837: Download Attachment doesn't work; Get some header information or Jabber | ||||
Description | uploading a file works fine so far, but if i try to download an attachment, i sometimes only get a text-file with a lots of jabber like: ans sometimes the file is opened in the browser and i see something like: 022003d0022003220006400650022000d000a00... ÿfe570069006e0064006f0077007300200052006... | ||||
Steps To Reproduce |
| ||||
Additional Information |
open_basedir = "C:\inetpub\wwwroot;C:\inetpub\temp;C:\inetpub\upload;"
| ||||
Tags | attachment, documentation-needed, download, iis, postgresql, utf8, windows | ||||
Postgres 9.0 changed default encoding for bytea. http://www.postgresql.org/docs/9.0/static/datatype-binary.html Current PHP pgsql function pg_unescape_bytea does not support this new encoding. http://www.php.net/manual/en/function.pg-unescape-bytea.php The workaround is to configure a property in the postgres database for the mantisbt user, to make postgres behave as the old default. ALTER USER mantisbt SET bytea_output = 'escape'; (or using the pgadmin interface) All the files already uploaded can be downloaded ok after this change. I had this problem, and solved it yesterday. I tested and reproduced it in RHEL 5.5 and opensuse 11.3 and 11.4. The problem also affect mantis 1.2.3 (and probably older versions) |
|
Thanks a lot for this hint! After I executed the query and added C:\PHP\magic\ to the open base dir path in the php.ini it works! |
|
also possible and maybe more useful: ALTER DATABASE mantisbt SET bytea_output = 'escape'; |
|
I confirm that dforce's workaround (0012837:0028476) is a good solution to this issue. The problem with the incorrect decoding of BLOB (bytea) columns lies in the underlying ADOdb library ADORecordSet_postgres64::_decode() function. This has been fixed in ADOdb version 5.14 (MantisBT 1.2.x currently ships with 5.10). |
|