Open LXG19961206 opened 9 months ago
Thanks for opening this. What are you really trying to achieve with this? Sending a file from JS counter-intuitive for a Go program. There's probably a better way of doing it.
Thanks for opening this. What are you really trying to achieve with this? Sending a file from JS counter-intuitive for a Go program. There's probably a better way of doing it.
My business needs to use HTMLCanvas to dynamically draw data, then convert it into images and hand it over to the Wails Golang process, Unable to directly call native functions of wails
cover to base64 data as string ,then send to go.
The signature blob any
is why you're getting map[string]interface{}
.
You need to serialize your data and then send it to wails like:
async function greet() {
let blob = new Blob(["hello world"], { type: "text/plain;charset=utf-8" });
// base64 encoded result:
const result = btoa(await blob.text());
Greet(result).then((result) => {
greeting = result;
});
}
func (a *App) Greet(blob string) string {
...
}
Is your feature request related to a problem? Please describe.
a simple code example here...
// js let blob = new Blob(["hello world"], {type: "text/plain;charset=utf-8"});
await ReceiveBlob(blob)
// wails go func (rec *app) (blob any) ReceiveBlob { ... // when I can this function, I got
map[string]interface{}
, and the map has no key , how can i receive it as a blob instance }Describe the solution you'd like
please help me
Describe alternatives you've considered
No response
Additional context
No response