Skip to content Skip to sidebar Skip to footer

Storing And Retrieving Images From DB2 Using Worklight SQL Adapters?

I'm trying to store images in DB2 Database as BLOB contents. I used JS to convert the image content to base64. function loadImageFileAsURL() { var filesSelected = document.getEle

Solution 1:

Why do you not simply store the image as encoded to base64 in database? I think this would be better in your scenario...

  1. You receive an image
  2. You use some library to handle the encoding to base64
    Review this question: Base64 encoding and decoding in client-side Javascript
  3. You store the image-now a string, in the database
  4. When you need to display the image in the app, fetch the contents and decode it (see step 2)

Post a Comment for "Storing And Retrieving Images From DB2 Using Worklight SQL Adapters?"