1. Download our Official Android App: Forums for Android!

How to save a file using selected BLOB from database?

Discussion in 'Android Help' started by Android Question, Feb 8, 2014.

  1. Android Question

    Thread Starter
    Rank:
    None
    Posts:
    0
    Joined:

    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
     

    Advertisement

  2. Rukbat

    Rukbat Android Expert
    Rank:
    None
    Points:
    843
    Posts:
    10,392
    Joined:
    Jan 16, 2012

    Jan 16, 2012
    10,392
    2,894
    843
    Male
    Being retired and writing Tasker tasks.
    Fayetteville, NC, USA
    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?
     

Share This Page

Loading...