[Gambas-user] Getting innerHTML of a WebControl

Benoît Minisini g4mba5 at gmail.com
Sat Sep 25 16:52:32 CEST 2021


Le 25/09/2021 à 15:56, Safiur Rahman a écrit :
> Hi
> 
>   I am using few procedures to get
>   1) I use canvas (sketchpad.js) to draw on screen. The js writes
> base64 encoded string of the image to WebHhtml's innerHTML. I have to
> save this string to database in server.
>   2) I scan QR code (qrcodelib.js and webcodecamjs.js) through webcam.
> I get a paragraph of text which I have to save to server.
> 
>   I could save short text to WebTextBox using
> 
>   Print "var data = ..... ;"
>   Print "$(" & JS(wbgeolocat.Name & ":entry") & ").value =  data;"
>   Print "gw.update(" & JS(wbgeolocat.Name) & ", 'text', data);"
> 
>   Then I could get the content of WebTextBox as WebTextBox.Text
> 
>   But in case of large data I want to use WebHTML to get data from js
> and then save to server.
> 

If you want to send a lot of binary data like an image to the server, I 
strongly suggest to upload the data directly to the server.

There is some internal upload management for the WebFileButton, but, 
alas, the browser prevents an upload button (<input type="file">) to 
trigger the upload without a user mouse click.

So I have to write some new code so that you can upload any data the 
server easily.

-- 
Benoît Minisini


More information about the User mailing list