Android Question Retrieving LONG BLOB DATA from a remote database.

gudino jose luis

Active Member
Licensed User
Longtime User
I'm having a trouble in retrieving a long blob data from a remote database of a servidor where in I'm accessing it using WiFi Connection using the code from this http://www.b4x.com/forum/basi...connect-android-mysql-database-tutorial.html thread of Admin Erel, I can successfully retrieve structured data such as Varchar data and Int data, but when i changed the query and select and retrieve these long blob data (which are unstructured data) I got an error. I could not retrieve the long blob data for me to store it in a variable after querying.

I tried using the StringUtils class and the DecodeBase64 method to remedy the error but again, it didn't worked.

Could i possibly manipulate it in the PHP script or in the Activity Module codes? How?

And after retrieving the long blob data how could i convert it in its original file type (e.g. sample.jpg)?


Please help me. THANK YOU. PLEASE....
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If you can use RDC instead then use it. It will be much easier.

You will need to update the PHP script and convert the blob to a base64 string. The device side is simple. You can then use StringUtils to convert the string to an array of bytes and save it to a file.

Another option is to store the files and only store their names in the database. You will then be able to download the files directly. It will also be more efficient.
 
Upvote 0
Top