I am trying to click a photo and upload it after clicking the button. So can you take a picture and upload it with a single click?
function snap(){ // Take a picture using the devices camera and retrieve an image as a // base64-encoded string. navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.DATA_URL }); } <button onclick="snap();">Snap</button>
If you just want to save a picture that doesn't matter whether the user selects it or not, set the saveToPhotoAlbum parameter in the getPicture method to true. Otherwise, if you want to upload the image to the server somewhere, you will need more work. Take a look at these articles that provide examples of how this is achieved:
Source: https://habr.com/ru/post/1484460/More articles:unusual exit from pow - cDo the main domains and common subdomains have different parts of the same domain model? - domain-driven-designKendo toolbar AddNew button does not work when mesh is filtered - kendo-uiforwarding rdp traffic using netsh - windowsSearchView text color in ActionBar using ActionBarSherlock - androidCan I scale to two Highcharts charts? - javascriptPHPUnit testing individually in Symfony - phpunitInsert or update MYSQL if exists in a one-way composite primary key table - phpPython interactive client / server with Twisted - pythonEmber.js: ensure that the linkTo helper maintains the active class along the nested route - ember.jsAll Articles