chillyroll Posted April 28, 2008 Share Posted April 28, 2008 Hello guys, I want help in returning LongBlob data in XML fro MySQL database. I am writing an API for Document Management and storing entire file in database. When I am returning the .doc file in SOAP response, the file contents stored in the database is affecting the XML structure of the SOAP response, as a result the response is not proper. As a work around, I am returning the contents after using base64_encode(). But i am not sure whether this is the optimal solution or no since for some case it MIGHT break the structure again. Also base64_encode() unnecessarily increasing the size of the response returned. So, can any one suggest me how to return the LongBlob in SOAP response??? Thanks in advance, Chillyroll!!! Quote Link to comment https://forums.phpfreaks.com/topic/103223-longblob-in-xml/ Share on other sites More sharing options...
sKunKbad Posted April 28, 2008 Share Posted April 28, 2008 declare the longblob as cdata in the XML Quote Link to comment https://forums.phpfreaks.com/topic/103223-longblob-in-xml/#findComment-528726 Share on other sites More sharing options...
chillyroll Posted April 28, 2008 Author Share Posted April 28, 2008 thanks for your reply! The XML structure is not created by me. Its the SOAP response XML output!!! Quote Link to comment https://forums.phpfreaks.com/topic/103223-longblob-in-xml/#findComment-528727 Share on other sites More sharing options...
chillyroll Posted April 28, 2008 Author Share Posted April 28, 2008 just to add some more to my original post, when I am returning the .txt files the XML output is proper and Valid, but when I try returning .doc files the file headers seem to cause problems... Quote Link to comment https://forums.phpfreaks.com/topic/103223-longblob-in-xml/#findComment-528728 Share on other sites More sharing options...
sKunKbad Posted April 28, 2008 Share Posted April 28, 2008 so whoever is generating the XML has not done a good job... perhaps you should fopen and fread the XML, explode it, and insert some cdata tags??? I would contact whoever is generating the XML and ask them. Quote Link to comment https://forums.phpfreaks.com/topic/103223-longblob-in-xml/#findComment-528737 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.