View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015551 | mantisbt | api soap | public | 2013-02-28 04:55 | 2014-11-07 02:14 |
Reporter | luismiguel.cabezas | Assigned To | rombert | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Linux | OS | Debian | OS Version | 5 |
Product Version | 1.2.14 | ||||
Summary | 0015551: mc_issue_attachment_add save corrupt file | ||||
Description | Hi, i am trying to send a file through SOAP with mc_issue_attachment_add. All ok but whn i see de database data are in base64 and not in binary format (if i use a form the file save perfect). I have modified function mci_file_add for solve this problem. i have add:
If a file come through SOAP $p_content is save after decode. Is solved to me. Is correctly this patch? Thanks!!! | ||||
Tags | No tags attached. | ||||
For me uploading attachments works just fine. How exactly do you add the file? Also, I'm interested in knowing if you have the php soap extensions activated or have made any modifications in api/soap/mc_config_inc.php. |
|
@rombert, I vaguely recall there were some issues and possibly discrepancies in the file_add API calls between MantisBT and SOAP. I had started working on this several months ago [1] but never actually got around to finishing the job. Maybe this is related. [1] https://github.com/dregad/mantisbt/tree/file-attach-fixes |
|
upload a file works fine. SOAP in server. The problem is when i try upload a file with SOAP. I use Ruby to attach a file with SOAP and code the file with Base64. The function mc_issue_attachment_add need decode base64 to save in db if the file come about SOAP. My code solve this problem. |
|
I think I know what's going on here. Probably your ruby SOAP library already encodes the file in Base64 for you. The Axis toolkit ( Java ) and PHP SOAP extension ( IIRC ) already do that. Try removing the Base64 encoding from your code and see what that does. |
|
I remember those, but I think this is unrelated. I've had my mistakes spelled out to me regarding attachments and Base64 encoding in bug 0011151, bug 0011471 and bug 0011039 so I'm pretty confident that this is done right. |
|
Based on a quick research I did today following a message on the mailing list [1] I wonder if this could be due to encoding the attachment twice (the PHP SOAP extension apparently handles the base64_encoding, according to [2] - not sure if nusoap does the same) [1] http://article.gmane.org/gmane.comp.bug-tracking.mantis.general/3548 |
|
Right, so the problem there was that the developer was encoding the data himself. But we can't control the client side, all we do is ensure that the data is correctly handled on the server side. |
|
Php soap client automatically encodes as well. Resolving as no change required. |
|