Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:48:01+00:00 2026-06-16T04:48:01+00:00

Hey everyone I know that its a controversial topic about storing either the image

  • 0

Hey everyone I know that its a controversial topic about storing either the image or the path to the image in the database however for this particular application when the user takes the picture I do not want them to be able to access it and with the way I transmit data to the server I need to send the blob.

Does anyone have a function that will take a picture and save it straight into a column in the sqlite database as a blob?

Thanks,
Currently I only have the following functions to handle images:

var pictureSource;  
var destinationType;

function onPhotoDataSuccess(imageData) {
    console.log("* * * onPhotoDataSuccess");
    var cameraImage = document.getElementById('cameraImage');
    cameraImage.style.visibility = 'visible';
    cameraImage.src = "data:image/jpeg;base64," + imageData;
}

function take_pic() {
    navigator.camera.getPicture(onPhotoDataSuccess, function(ex) {
        alert("Camera Error!");
    }, { quality : 30, destinationType: Camera.DestinationType.DATA_URL });
}

Thanks again everyone!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:48:02+00:00Added an answer on June 16, 2026 at 4:48 am

    I found this: Phonegap Database problem – storing images in the database

    there is an answer to it so that should do the trick for you.

    a raw example:

    function onPhotoDataSuccess(imageData) {                
       // Get image handle
       var smallImage = document.getElementById('smallImage');
    
       // Unhide image elements
       smallImage.style.display = 'block';
       smallImage.src = imageData;
    
       /* do something else with imageData :) */
    
    }
    

    Read this too please:

    http://docs.phonegap.com/en/1.0.0/phonegap_camera_camera.md.html

    This is a part of it, but please read before that too 😉

    You can do whatever you want with the encoded image or URI, for example:

    Render the image in an tag (see example below) Save the data
    locally (LocalStorage, Lawnchair, etc) Post the data to a remote
    server

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey everyone, I have a database result that returns from a method. I need
Hey everyone quick question, I know this sounds strange to do in javascript but
Hey everyone. The following is the code that I am using to play random
hey everyone... so i'm working on a database design class for university. I've got
Hey everyone, I have written a script that downloads a zip file from a
Hey everyone, this seems like it should be a simple one; I really hope
Hey everyone I am building a website that needs to have the capability to
Hey everyone. I am working on an app that displays a modal the first
Hey everyone i am trying to write this code and I am having problems
Hey everyone I'm currently extremely frustrated and can not figure this out have looked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.