• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to save a file using selected BLOB from database?

  • Thread starter Thread starter Android Question
  • Start date Start date
A

Android Question

Guest
I am able to save selected pdf files from my mobile to my remote database MySQL as BLOB data type. But now I would like to select a particular BLOB data from MySQL using android and then create a pdf file using that BLOB data and save it to my sd card on my mobile!

Any help on how to achieve this?? Thanks
 
At the risk of being told that it's not what you asked, NEVER save files as BLOB data.

Save the original pdf file as a pdf file. Save its location as text in the database. (That's rule #2 in databases, Rule #1 is "normalize".)

How to do it now? If the BLOB is already the pdf file, just read it out (a SELECT statement) and write it to a file. If it's not a pdf file, in what language do you want to write this code, using what pdf library?
 
Back
Top Bottom