Created
December 14, 2019 16:59
-
-
Save grekodev/6842ee7644bbeed33217156ca6de6fe0 to your computer and use it in GitHub Desktop.
Revisions
-
grekodev renamed this gist
Dec 14, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
grekodev created this gist
Dec 14, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ PHP ======= public function readImage() { header('Content-type: image/jpeg'); echo file_get_contents("http://app1.susalud.gob.pe/registro/Home/GeneraCaptcha?accion=image"); } =================================================================================================== JS ======= function getCaptcha(url_image) { fetch(url_image) .then(response => response.blob()) .then(images => { var reader = new window.FileReader(); reader.readAsDataURL(images); reader.onload = function () { var imageDataUrl = reader.result; let imageElement = document.getElementById('image'); imageElement.setAttribute("src", imageDataUrl); } }) } =================================================================================================== HTML ======= <img id="image" alt="">